@quoin-cms/admin 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -1
- package/src/AdminRoot.svelte +7 -7
- package/src/lib/api/auth.ts +3 -6
- package/src/lib/api/files.ts +3 -2
- package/src/lib/components/AdminSidebar.svelte +23 -23
- package/src/lib/components/DocumentEditLayout.svelte +17 -0
- package/src/lib/components/DynamicForm.svelte +3 -3
- package/src/lib/components/MediaLibrary.svelte +55 -7
- package/src/lib/components/RecordTable.svelte +33 -21
- package/src/lib/components/UploadCreateView.svelte +173 -0
- package/src/lib/components/doc/ApiView.svelte +95 -103
- package/src/lib/components/doc/RenderJson.svelte +93 -0
- package/src/lib/components/fields/RichTextField.svelte +5 -0
- package/src/lib/components/fields/UploadField.svelte +26 -34
- package/src/lib/components/fields/UploadGalleryField.svelte +28 -37
- package/src/lib/components/lexical/BlockField.svelte +41 -0
- package/src/lib/components/lexical/BlockHost.svelte +85 -0
- package/src/lib/components/lexical/BlockNode.ts +102 -0
- package/src/lib/components/lexical/block-defaults.ts +40 -0
- package/src/lib/components/lexical/lexical-helpers.ts +3 -0
- package/src/lib/components/lexical/nodes.ts +2 -0
- package/src/lib/components/lexical/toolbar/InsertBlockDropdown.svelte +27 -2
- package/src/lib/context.svelte.ts +1 -0
- package/src/lib/types/schema.ts +15 -0
- package/src/views/CollectionListView.svelte +63 -21
- package/src/views/CollectionNewView.svelte +3 -0
- package/src/views/DashboardSlot.svelte +46 -0
- package/src/views/DashboardView.svelte +78 -339
- package/src/views/LoginView.svelte +47 -23
- package/biome.json +0 -62
- package/dist/assets/index-C9Y5-AKj.js +0 -33
- package/dist/assets/index-uVdiUjty.css +0 -1
- package/dist/index.html +0 -20
- package/index.html +0 -19
- package/src/views/AdsAnalyticsView.svelte +0 -152
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -80
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();const Yp=!1;var Cu=Array.isArray,Zp=Array.prototype.indexOf,Qi=Array.prototype.includes,_a=Array.from,ag=Object.defineProperty,Dr=Object.getOwnPropertyDescriptor,lg=Object.getOwnPropertyDescriptors,Xp=Object.prototype,Qp=Array.prototype,Tu=Object.getPrototypeOf,Fc=Object.isExtensible;function wo(n){return typeof n=="function"}const Nt=()=>{};function $p(n){return typeof n?.then=="function"}function em(n){return n()}function Al(n){for(var e=0;e<n.length;e++)n[e]()}function ug(){var n,e,t=new Promise((r,i)=>{n=r,e=i});return{promise:t,resolve:n,reject:e}}function cg(n,e){if(Array.isArray(n))return n;if(!(Symbol.iterator in n))return Array.from(n);const t=[];for(const r of n)if(t.push(r),t.length===e)break;return t}const en=2,$i=4,es=8,Eu=1<<24,Yn=16,Un=32,zr=64,Ml=128,Cn=512,Rt=1024,Jt=2048,nr=4096,on=8192,mn=16384,_i=32768,Pl=1<<25,yr=65536,Ol=1<<17,tm=1<<18,fo=1<<19,dg=1<<20,Gn=1<<25,si=65536,Dl=1<<21,Bo=1<<22,Ir=1<<23,Zn=Symbol("$state"),fg=Symbol("legacy props"),nm=Symbol(""),pr=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Nu=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");function Au(n){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function rm(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function im(n,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function om(n){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sm(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function am(n){throw new Error("https://svelte.dev/e/effect_orphan")}function lm(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function um(n){throw new Error("https://svelte.dev/e/props_invalid_value")}function cm(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function dm(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function fm(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function gm(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const hm=1,vm=2,gg=4,pm=8,mm=16,_m=1,bm=2,hg=4,ym=8,xm=16,vg=1,wm=2,Dt=Symbol(),pg="http://www.w3.org/1999/xhtml",mg="http://www.w3.org/2000/svg",km="http://www.w3.org/1998/Math/MathML",Sm="@attach";function Cm(){console.warn("https://svelte.dev/e/derived_inert")}function Tm(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Em(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function _g(n){return n===this.v}function bg(n,e){return n!=n?e==e:n!==e||n!==null&&typeof n=="object"||typeof n=="function"}function yg(n){return!bg(n,this.v)}let go=!1,Nm=!1;function Am(){go=!0}let yt=null;function eo(n){yt=n}function to(n){return ba().get(n)}function bi(n,e){return ba().set(n,e),e}function Mm(n){return ba().has(n)}function Pm(){return ba()}function he(n,e=!1,t){yt={p:yt,i:!1,c:null,e:null,s:n,x:null,r:Qe,l:go&&!e?{s:null,u:null,$:[]}:null}}function ve(n){var e=yt,t=e.e;if(t!==null){e.e=null;for(var r of t)Kg(r)}return n!==void 0&&(e.x=n),e.i=!0,yt=e.p,n??{}}function ho(){return!go||yt!==null&&yt.l===null}function ba(n){return yt===null&&Au(),yt.c??=new Map(Om(yt)||void 0)}function Om(n){let e=n.p;for(;e!==null;){const t=e.c;if(t!==null)return t;e=e.p}return null}let Xr=[];function xg(){var n=Xr;Xr=[],Al(n)}function Xn(n){if(Xr.length===0&&!Hi){var e=Xr;queueMicrotask(()=>{e===Xr&&xg()})}Xr.push(n)}function Dm(){for(;Xr.length>0;)xg()}function wg(n){var e=Qe;if(e===null)return at.f|=Ir,n;if((e.f&_i)===0&&(e.f&$i)===0)throw n;Ar(n,e)}function Ar(n,e){for(;e!==null;){if((e.f&Ml)!==0){if((e.f&_i)===0)throw n;try{e.b.error(n);return}catch(t){n=t}}e=e.parent}throw n}const Im=-7169;function At(n,e){n.f=n.f&Im|e}function Mu(n){(n.f&Cn)!==0||n.deps===null?At(n,Rt):At(n,nr)}function kg(n){if(n!==null)for(const e of n)(e.f&en)===0||(e.f&si)===0||(e.f^=si,kg(e.deps))}function Sg(n,e,t){(n.f&Jt)!==0?e.add(n):(n.f&nr)!==0&&t.add(n),kg(n.deps),At(n,Rt)}function Cg(n,e,t){if(n==null)return e(void 0),Nt;const r=Yt(()=>n.subscribe(e,t));return r.unsubscribe?()=>r.unsubscribe():r}const Ni=[];function Pu(n,e=Nt){let t=null;const r=new Set;function i(a){if(bg(n,a)&&(n=a,t)){const u=!Ni.length;for(const c of r)c[1](),Ni.push(c,n);if(u){for(let c=0;c<Ni.length;c+=2)Ni[c][0](Ni[c+1]);Ni.length=0}}}function o(a){i(a(n))}function s(a,u=Nt){const c=[a,u];return r.add(c),r.size===1&&(t=e(i,o)||Nt),a(n),()=>{r.delete(c),r.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:s}}function Fm(n){let e;return Cg(n,t=>e=t)(),e}let Il=!1,xs=!1,Fl=Symbol();function Wi(n,e,t){const r=t[e]??={store:null,source:Gs(void 0),unsubscribe:Nt};if(r.store!==n&&!(Fl in t))if(r.unsubscribe(),r.store=n??null,n==null)r.source.v=void 0,r.unsubscribe=Nt;else{var i=!0;r.unsubscribe=Cg(n,o=>{i?r.source.v=o:A(r.source,o)}),i=!1}return n&&Fl in t?Fm(n):l(r.source)}function Ki(n,e){return Lm(n,e),e}function ya(){const n={};function e(){rs(()=>{for(var t in n)n[t].unsubscribe();ag(n,Fl,{enumerable:!1,value:!0})})}return[n,e]}function Lm(n,e){Il=!0;try{n.set(e)}finally{Il=!1}}function Rm(n){var e=xs;try{return xs=!1,[n(),xs]}finally{xs=e}}const Vr=new Set;let qe=null,Ln=null,Ll=null,Hi=!1,Qa=!1,Bi=null,Bs=null;var Lc=0;let zm=1;class xr{id=zm++;current=new Map;previous=new Map;#e=new Set;#n=new Set;#t=new Set;#o=new Map;#i=new Map;#s=null;#r=[];#a=[];#u=new Set;#c=new Set;#l=new Map;#f=new Set;is_fork=!1;#h=!1;#g=new Set;#d(){return this.is_fork||this.#i.size>0}#m(){for(const r of this.#g)for(const i of r.#i.keys()){for(var e=!1,t=i;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]}),this.#f.delete(e)}unskip_effect(e,t=r=>this.schedule(r)){var r=this.#l.get(e);if(r){this.#l.delete(e);for(var i of r.d)At(i,Jt),t(i);for(i of r.m)At(i,nr),t(i)}this.#f.add(e)}#v(){if(Lc++>1e3&&(Vr.delete(this),Bm()),!this.#d()){for(const a of this.#u)this.#c.delete(a),At(a,Jt),this.schedule(a);for(const a of this.#c)At(a,nr),this.schedule(a)}const e=this.#r;this.#r=[],this.apply();var t=Bi=[],r=[],i=Bs=[];for(const a of e)try{this.#_(a,t,r)}catch(u){throw Ag(a),u}if(qe=null,i.length>0){var o=xr.ensure();for(const a of i)o.schedule(a)}if(Bi=null,Bs=null,this.#d()||this.#m()){this.#p(r),this.#p(t);for(const[a,u]of this.#l)Ng(a,u)}else{this.#o.size===0&&Vr.delete(this),this.#u.clear(),this.#c.clear();for(const a of this.#e)a(this);this.#e.clear(),Rc(r),Rc(t),this.#s?.resolve()}var s=qe;if(this.#r.length>0){const a=s??=this;a.#r.push(...this.#r.filter(u=>!a.#r.includes(u)))}s!==null&&(Vr.add(s),s.#v())}#_(e,t,r){e.f^=Rt;for(var i=e.first;i!==null;){var o=i.f,s=(o&(Un|zr))!==0,a=s&&(o&Rt)!==0,u=a||(o&on)!==0||this.#l.has(i);if(!u&&i.fn!==null){s?i.f^=Rt:(o&$i)!==0?t.push(i):is(i)&&((o&Yn)!==0&&this.#c.add(i),no(i));var c=i.first;if(c!==null){i=c;continue}}for(;i!==null;){var d=i.next;if(d!==null){i=d;break}i=i.parent}}}#p(e){for(var t=0;t<e.length;t+=1)Sg(e[t],this.#u,this.#c)}capture(e,t,r=!1){e.v!==Dt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Ir)===0&&(this.current.set(e,[t,r]),Ln?.set(e,t)),this.is_fork||(e.v=t)}activate(){qe=this}deactivate(){qe=null,Ln=null}flush(){try{Qa=!0,qe=this,this.#v()}finally{Lc=0,Ll=null,Bi=null,Bs=null,Qa=!1,qe=null,Ln=null,$r.clear()}}discard(){for(const e of this.#n)e(this);this.#n.clear(),this.#t.clear(),Vr.delete(this)}register_created_effect(e){this.#a.push(e)}#b(){for(const d of Vr){var e=d.id<this.id,t=[];for(const[f,[g,p]]of this.current){if(d.current.has(f)){var r=d.current.get(f)[0];if(e&&g!==r)d.current.set(f,[g,p]);else continue}t.push(f)}var i=[...d.current.keys()].filter(f=>!this.current.has(f));if(i.length===0)e&&d.discard();else if(t.length>0){if(e)for(const f of this.#f)d.unskip_effect(f,g=>{(g.f&(Yn|Bo))!==0?d.schedule(g):d.#p([g])});d.activate();var o=new Set,s=new Map;for(var a of t)Eg(a,i,o,s);s=new Map;var u=[...d.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f:!0);for(const f of this.#a)(f.f&(mn|on|Ol))===0&&Ou(f,u,s)&&((f.f&(Bo|Yn))!==0?(At(f,Jt),d.schedule(f)):d.#u.add(f));if(d.#r.length>0){d.apply();for(var c of d.#r)d.#_(c,[],[]);d.#r=[]}d.deactivate()}}for(const d of Vr)d.#g.has(this)&&(d.#g.delete(this),d.#g.size===0&&!d.#d()&&(d.activate(),d.#v()))}increment(e,t){let r=this.#o.get(t)??0;if(this.#o.set(t,r+1),e){let i=this.#i.get(t)??0;this.#i.set(t,i+1)}}decrement(e,t,r){let i=this.#o.get(t)??0;if(i===1?this.#o.delete(t):this.#o.set(t,i-1),e){let o=this.#i.get(t)??0;o===1?this.#i.delete(t):this.#i.set(t,o-1)}this.#h||r||(this.#h=!0,Xn(()=>{this.#h=!1,this.flush()}))}transfer_effects(e,t){for(const r of e)this.#u.add(r);for(const r of t)this.#c.add(r);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#n.add(e)}on_fork_commit(e){this.#t.add(e)}run_fork_commit_callbacks(){for(const e of this.#t)e(this);this.#t.clear()}settled(){return(this.#s??=ug()).promise}static ensure(){if(qe===null){const e=qe=new xr;Qa||(Vr.add(qe),Hi||Xn(()=>{qe===e&&e.flush()}))}return qe}apply(){{Ln=null;return}}schedule(e){if(Ll=e,e.b?.is_pending&&(e.f&($i|es|Eu))!==0&&(e.f&_i)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(Bi!==null&&t===Qe&&(at===null||(at.f&en)===0)&&!Il)return;if((r&(zr|Un))!==0){if((r&Rt)===0)return;t.f^=Rt}}this.#r.push(t)}}function Tg(n){var e=Hi;Hi=!0;try{for(var t;;){if(Dm(),qe===null)return t;qe.flush()}}finally{Hi=e}}function Bm(){try{lm()}catch(n){Ar(n,Ll)}}let hr=null;function Rc(n){var e=n.length;if(e!==0){for(var t=0;t<e;){var r=n[t++];if((r.f&(mn|on))===0&&is(r)&&(hr=new Set,no(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&qg(r),hr?.size>0)){$r.clear();for(const i of hr){if((i.f&(mn|on))!==0)continue;const o=[i];let s=i.parent;for(;s!==null;)hr.has(s)&&(hr.delete(s),o.push(s)),s=s.parent;for(let a=o.length-1;a>=0;a--){const u=o[a];(u.f&(mn|on))===0&&no(u)}}hr.clear()}}hr=null}}function Eg(n,e,t,r){if(!t.has(n)&&(t.add(n),n.reactions!==null))for(const i of n.reactions){const o=i.f;(o&en)!==0?Eg(i,e,t,r):(o&(Bo|Yn))!==0&&(o&Jt)===0&&Ou(i,e,r)&&(At(i,Jt),Du(i))}}function Ou(n,e,t){const r=t.get(n);if(r!==void 0)return r;if(n.deps!==null)for(const i of n.deps){if(Qi.call(e,i))return!0;if((i.f&en)!==0&&Ou(i,e,t))return t.set(i,!0),!0}return t.set(n,!1),!1}function Du(n){qe.schedule(n)}function Ng(n,e){if(!((n.f&Un)!==0&&(n.f&Rt)!==0)){(n.f&Jt)!==0?e.d.push(n):(n.f&nr)!==0&&e.m.push(n),At(n,Rt);for(var t=n.first;t!==null;)Ng(t,e),t=t.next}}function Ag(n){At(n,Rt);for(var e=n.first;e!==null;)Ag(e),e=e.next}function Mg(n){let e=0,t=rr(0),r;return()=>{zu()&&(l(t),ka(()=>(e===0&&(r=Yt(()=>n(()=>Oo(t)))),e+=1,()=>{Xn(()=>{e-=1,e===0&&(r?.(),r=void 0,Oo(t))})})))}}var Um=yr|fo;function jm(n,e,t,r){new Wm(n,e,t,r)}class Wm{parent;is_pending=!1;transform_error;#e;#n=null;#t;#o;#i;#s=null;#r=null;#a=null;#u=null;#c=0;#l=0;#f=!1;#h=new Set;#g=new Set;#d=null;#m=Mg(()=>(this.#d=rr(this.#c),()=>{this.#d=null}));constructor(e,t,r,i){this.#e=e,this.#t=t,this.#o=o=>{var s=Qe;s.b=this,s.f|=Ml,r(o)},this.parent=Qe.b,this.transform_error=i??this.parent?.transform_error??(o=>o),this.#i=yi(()=>{this.#b()},Um)}#v(){try{this.#s=an(()=>this.#o(this.#e))}catch(e){this.error(e)}}#_(e){const t=this.#t.failed;t&&(this.#a=an(()=>{t(this.#e,()=>e,()=>()=>{})}))}#p(){const e=this.#t.pending;e&&(this.is_pending=!0,this.#r=an(()=>e(this.#e)),Xn(()=>{var t=this.#u=document.createDocumentFragment(),r=Qn();t.append(r),this.#s=this.#x(()=>an(()=>this.#o(r))),this.#l===0&&(this.#e.before(t),this.#u=null,ei(this.#r,()=>{this.#r=null}),this.#y(qe))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#c=0,this.#s=an(()=>{this.#o(this.#e)}),this.#l>0){var e=this.#u=document.createDocumentFragment();ju(this.#s,e);const t=this.#t.pending;this.#r=an(()=>t(this.#e))}else this.#y(qe)}catch(t){this.error(t)}}#y(e){this.is_pending=!1,e.transfer_effects(this.#h,this.#g)}defer_effect(e){Sg(e,this.#h,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#x(e){var t=Qe,r=at,i=yt;An(this.#i),Nn(this.#i),eo(this.#i.ctx);try{return xr.ensure(),e()}catch(o){return wg(o),null}finally{An(t),Nn(r),eo(i)}}#w(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(e,t);return}this.#l+=e,this.#l===0&&(this.#y(t),this.#r&&ei(this.#r,()=>{this.#r=null}),this.#u&&(this.#e.before(this.#u),this.#u=null))}update_pending_count(e,t){this.#w(e,t),this.#c+=e,!(!this.#d||this.#f)&&(this.#f=!0,Xn(()=>{this.#f=!1,this.#d&&_r(this.#d,this.#c)}))}get_effect_pending(){return this.#m(),l(this.#d)}error(e){if(!this.#t.onerror&&!this.#t.failed)throw e;qe?.is_fork?(this.#s&&qe.skip_effect(this.#s),this.#r&&qe.skip_effect(this.#r),this.#a&&qe.skip_effect(this.#a),qe.on_fork_commit(()=>{this.#k(e)})):this.#k(e)}#k(e){this.#s&&(qt(this.#s),this.#s=null),this.#r&&(qt(this.#r),this.#r=null),this.#a&&(qt(this.#a),this.#a=null);var t=this.#t.onerror;let r=this.#t.failed;var i=!1,o=!1;const s=()=>{if(i){Em();return}i=!0,o&&gm(),this.#a!==null&&ei(this.#a,()=>{this.#a=null}),this.#x(()=>{this.#b()})},a=u=>{try{o=!0,t?.(u,s),o=!1}catch(c){Ar(c,this.#i&&this.#i.parent)}r&&(this.#a=this.#x(()=>{try{return an(()=>{var c=Qe;c.b=this,c.f|=Ml,r(this.#e,()=>u,()=>s)})}catch(c){return Ar(c,this.#i.parent),null}}))};Xn(()=>{var u;try{u=this.transform_error(e)}catch(c){Ar(c,this.#i&&this.#i.parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(a,c=>Ar(c,this.#i&&this.#i.parent)):a(u)})}}function Pg(n,e,t,r){const i=ho()?ts:Iu;var o=n.filter(g=>!g.settled);if(t.length===0&&o.length===0){r(e.map(i));return}var s=Qe,a=Og(),u=o.length===1?o[0].promise:o.length>1?Promise.all(o.map(g=>g.promise)):null;function c(g){a();try{r(g)}catch(p){(s.f&mn)===0&&Ar(p,s)}Uo()}if(t.length===0){u.then(()=>c(e.map(i)));return}var d=Dg();function f(){Promise.all(t.map(g=>Km(g))).then(g=>c([...e.map(i),...g])).catch(g=>Ar(g,s)).finally(()=>d())}u?u.then(()=>{a(),f(),Uo()}):f()}function Og(){var n=Qe,e=at,t=yt,r=qe;return function(o=!0){An(n),Nn(e),eo(t),o&&(n.f&mn)===0&&(r?.activate(),r?.apply())}}function Uo(n=!0){An(null),Nn(null),eo(null),n&&qe?.deactivate()}function Dg(){var n=Qe,e=n.b,t=qe,r=e.is_rendered();return e.update_pending_count(1,t),t.increment(r,n),(i=!1)=>{e.update_pending_count(-1,t),t.decrement(r,n,i)}}function ts(n){var e=en|Jt;return Qe!==null&&(Qe.f|=fo),{ctx:yt,deps:null,effects:null,equals:_g,f:e,fn:n,reactions:null,rv:0,v:Dt,wv:0,parent:Qe,ac:null}}function Km(n,e,t){let r=Qe;r===null&&rm();var i=void 0,o=rr(Dt),s=!at,a=new Map;return t_(()=>{var u=Qe,c=ug();i=c.promise;try{Promise.resolve(n()).then(c.resolve,c.reject).finally(Uo)}catch(p){c.reject(p),Uo()}var d=qe;if(s){if((u.f&_i)!==0)var f=Dg();if(r.b.is_rendered())a.get(d)?.reject(pr),a.delete(d);else{for(const p of a.values())p.reject(pr);a.clear()}a.set(d,c)}const g=(p,v=void 0)=>{if(f){var m=v===pr;f(m)}if(!(v===pr||(u.f&mn)!==0)){if(d.activate(),v)o.f|=Ir,_r(o,v);else{(o.f&Ir)!==0&&(o.f^=Ir),_r(o,p);for(const[h,w]of a){if(a.delete(h),h===d)break;w.reject(pr)}}d.deactivate()}};c.promise.then(g,p=>g(null,p||"unknown"))}),rs(()=>{for(const u of a.values())u.reject(pr)}),new Promise(u=>{function c(d){function f(){d===i?u(o):c(i)}d.then(f,f)}c(i)})}function z(n){const e=ts(n);return Zg(e),e}function Iu(n){const e=ts(n);return e.equals=yg,e}function Hm(n){var e=n.effects;if(e!==null){n.effects=null;for(var t=0;t<e.length;t+=1)qt(e[t])}}function Fu(n){var e,t=Qe,r=n.parent;if(!wr&&r!==null&&(r.f&(mn|on))!==0)return Cm(),n.v;An(r);try{n.f&=~si,Hm(n),e=eh(n)}finally{An(t)}return e}function Ig(n){var e=Fu(n);if(!n.equals(e)&&(n.wv=Qg(),(!qe?.is_fork||n.deps===null)&&(qe!==null?qe.capture(n,e,!0):n.v=e,n.deps===null))){At(n,Rt);return}wr||(Ln!==null?(zu()||qe?.is_fork)&&Ln.set(n,e):Mu(n))}function Vm(n){if(n.effects!==null)for(const e of n.effects)(e.teardown||e.ac)&&(e.teardown?.(),e.ac?.abort(pr),e.teardown=Nt,e.ac=null,Wo(e,0),Bu(e))}function Fg(n){if(n.effects!==null)for(const e of n.effects)e.teardown&&no(e)}let Rl=new Set;const $r=new Map;let Lg=!1;function rr(n,e){var t={f:0,v:n,reactions:null,equals:_g,rv:0,wv:0};return t}function Q(n,e){const t=rr(n);return Zg(t),t}function Gs(n,e=!1,t=!0){const r=rr(n);return e||(r.equals=yg),go&&t&&yt!==null&&yt.l!==null&&(yt.l.s??=[]).push(r),r}function A(n,e,t=!1){at!==null&&(!Rn||(at.f&Ol)!==0)&&ho()&&(at.f&(en|Yn|Bo|Ol))!==0&&(Tn===null||!Qi.call(Tn,n))&&fm();let r=t?We(e):e;return _r(n,r,Bs)}function _r(n,e,t=null){if(!n.equals(e)){$r.set(n,wr?e:n.v);var r=xr.ensure();if(r.capture(n,e),(n.f&en)!==0){const i=n;(n.f&Jt)!==0&&Fu(i),Ln===null&&Mu(i)}n.wv=Qg(),Rg(n,Jt,t),ho()&&Qe!==null&&(Qe.f&Rt)!==0&&(Qe.f&(Un|zr))===0&&(xn===null?r_([n]):xn.push(n)),!r.is_fork&&Rl.size>0&&!Lg&&Jm()}return e}function Jm(){Lg=!1;for(const n of Rl)(n.f&Rt)!==0&&At(n,nr),is(n)&&no(n);Rl.clear()}function Ys(n,e=1){var t=l(n),r=e===1?t++:t--;return A(n,t),r}function Oo(n){A(n,n.v+1)}function Rg(n,e,t){var r=n.reactions;if(r!==null)for(var i=ho(),o=r.length,s=0;s<o;s++){var a=r[s],u=a.f;if(!(!i&&a===Qe)){var c=(u&Jt)===0;if(c&&At(a,e),(u&en)!==0){var d=a;Ln?.delete(d),(u&si)===0&&(u&Cn&&(a.f|=si),Rg(d,nr,t))}else if(c){var f=a;(u&Yn)!==0&&hr!==null&&hr.add(f),t!==null?t.push(f):Du(f)}}}}function We(n){if(typeof n!="object"||n===null||Zn in n)return n;const e=Tu(n);if(e!==Xp&&e!==Qp)return n;var t=new Map,r=Cu(n),i=Q(0),o=ti,s=a=>{if(ti===o)return a();var u=at,c=ti;Nn(null),jc(o);var d=a();return Nn(u),jc(c),d};return r&&t.set("length",Q(n.length)),new Proxy(n,{defineProperty(a,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&cm();var d=t.get(u);return d===void 0?s(()=>{var f=Q(c.value);return t.set(u,f),f}):A(d,c.value,!0),!0},deleteProperty(a,u){var c=t.get(u);if(c===void 0){if(u in a){const d=s(()=>Q(Dt));t.set(u,d),Oo(i)}}else A(c,Dt),Oo(i);return!0},get(a,u,c){if(u===Zn)return n;var d=t.get(u),f=u in a;if(d===void 0&&(!f||Dr(a,u)?.writable)&&(d=s(()=>{var p=We(f?a[u]:Dt),v=Q(p);return v}),t.set(u,d)),d!==void 0){var g=l(d);return g===Dt?void 0:g}return Reflect.get(a,u,c)},getOwnPropertyDescriptor(a,u){var c=Reflect.getOwnPropertyDescriptor(a,u);if(c&&"value"in c){var d=t.get(u);d&&(c.value=l(d))}else if(c===void 0){var f=t.get(u),g=f?.v;if(f!==void 0&&g!==Dt)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return c},has(a,u){if(u===Zn)return!0;var c=t.get(u),d=c!==void 0&&c.v!==Dt||Reflect.has(a,u);if(c!==void 0||Qe!==null&&(!d||Dr(a,u)?.writable)){c===void 0&&(c=s(()=>{var g=d?We(a[u]):Dt,p=Q(g);return p}),t.set(u,c));var f=l(c);if(f===Dt)return!1}return d},set(a,u,c,d){var f=t.get(u),g=u in a;if(r&&u==="length")for(var p=c;p<f.v;p+=1){var v=t.get(p+"");v!==void 0?A(v,Dt):p in a&&(v=s(()=>Q(Dt)),t.set(p+"",v))}if(f===void 0)(!g||Dr(a,u)?.writable)&&(f=s(()=>Q(void 0)),A(f,We(c)),t.set(u,f));else{g=f.v!==Dt;var m=s(()=>We(c));A(f,m)}var h=Reflect.getOwnPropertyDescriptor(a,u);if(h?.set&&h.set.call(d,c),!g){if(r&&typeof u=="string"){var w=t.get("length"),b=Number(u);Number.isInteger(b)&&b>=w.v&&A(w,b+1)}Oo(i)}return!0},ownKeys(a){l(i);var u=Reflect.ownKeys(a).filter(f=>{var g=t.get(f);return g===void 0||g.v!==Dt});for(var[c,d]of t)d.v!==Dt&&!(c in a)&&u.push(c);return u},setPrototypeOf(){dm()}})}function zc(n){try{if(n!==null&&typeof n=="object"&&Zn in n)return n[Zn]}catch{}return n}function qm(n,e){return Object.is(zc(n),zc(e))}var jo,zg,Bg,Ug;function Gm(){if(jo===void 0){jo=window,zg=/Firefox/.test(navigator.userAgent);var n=Element.prototype,e=Node.prototype,t=Text.prototype;Bg=Dr(e,"firstChild").get,Ug=Dr(e,"nextSibling").get,Fc(n)&&(n.__click=void 0,n.__className=void 0,n.__attributes=null,n.__style=void 0,n.__e=void 0),Fc(t)&&(t.__t=void 0)}}function Qn(n=""){return document.createTextNode(n)}function vn(n){return Bg.call(n)}function ns(n){return Ug.call(n)}function _(n,e){return vn(n)}function q(n,e=!1){{var t=vn(n);return t instanceof Comment&&t.data===""?ns(t):t}}function T(n,e=1,t=!1){let r=n;for(;e--;)r=ns(r);return r}function Ym(n){n.textContent=""}function jg(){return!1}function Lu(n,e,t){return document.createElementNS(e??pg,n,void 0)}function Zm(n,e){if(e){const t=document.body;n.autofocus=!0,Xn(()=>{document.activeElement===t&&n.focus()})}}let Bc=!1;function Xm(){Bc||(Bc=!0,document.addEventListener("reset",n=>{Promise.resolve().then(()=>{if(!n.defaultPrevented)for(const e of n.target.elements)e.__on_r?.()})},{capture:!0}))}function xa(n){var e=at,t=Qe;Nn(null),An(null);try{return n()}finally{Nn(e),An(t)}}function Ru(n,e,t,r=t){n.addEventListener(e,()=>xa(t));const i=n.__on_r;i?n.__on_r=()=>{i(),r(!0)}:n.__on_r=()=>r(!0),Xm()}function Wg(n){Qe===null&&(at===null&&am(),sm()),wr&&om()}function Qm(n,e){var t=e.last;t===null?e.last=e.first=n:(t.next=n,n.prev=t,e.last=n)}function Wn(n,e){var t=Qe;t!==null&&(t.f&on)!==0&&(n|=on);var r={ctx:yt,deps:null,nodes:null,f:n|Jt|Cn,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};qe?.register_created_effect(r);var i=r;if((n&$i)!==0)Bi!==null?Bi.push(r):xr.ensure().schedule(r);else if(e!==null){try{no(r)}catch(s){throw qt(r),s}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&fo)===0&&(i=i.first,(n&Yn)!==0&&(n&yr)!==0&&i!==null&&(i.f|=yr))}if(i!==null&&(i.parent=t,t!==null&&Qm(i,t),at!==null&&(at.f&en)!==0&&(n&zr)===0)){var o=at;(o.effects??=[]).push(i)}return r}function zu(){return at!==null&&!Rn}function rs(n){const e=Wn(es,null);return At(e,Rt),e.teardown=n,e}function gt(n){Wg();var e=Qe.f,t=!at&&(e&Un)!==0&&(e&_i)===0;if(t){var r=yt;(r.e??=[]).push(n)}else return Kg(n)}function Kg(n){return Wn($i|dg,n)}function $m(n){return Wg(),Wn(es|dg,n)}function e_(n){xr.ensure();const e=Wn(zr|fo,n);return(t={})=>new Promise(r=>{t.outro?ei(e,()=>{qt(e),r(void 0)}):(qt(e),r(void 0))})}function wa(n){return Wn($i,n)}function t_(n){return Wn(Bo|fo,n)}function ka(n,e=0){return Wn(es|e,n)}function J(n,e=[],t=[],r=[]){Pg(r,e,t,i=>{Wn(es,()=>n(...i.map(l)))})}function yi(n,e=0){var t=Wn(Yn|e,n);return t}function Hg(n,e=0){var t=Wn(Eu|e,n);return t}function an(n){return Wn(Un|fo,n)}function Vg(n){var e=n.teardown;if(e!==null){const t=wr,r=at;Uc(!0),Nn(null);try{e.call(null)}finally{Uc(t),Nn(r)}}}function Bu(n,e=!1){var t=n.first;for(n.first=n.last=null;t!==null;){const i=t.ac;i!==null&&xa(()=>{i.abort(pr)});var r=t.next;(t.f&zr)!==0?t.parent=null:qt(t,e),t=r}}function n_(n){for(var e=n.first;e!==null;){var t=e.next;(e.f&Un)===0&&qt(e),e=t}}function qt(n,e=!0){var t=!1;(e||(n.f&tm)!==0)&&n.nodes!==null&&n.nodes.end!==null&&(Jg(n.nodes.start,n.nodes.end),t=!0),At(n,Pl),Bu(n,e&&!t),Wo(n,0);var r=n.nodes&&n.nodes.t;if(r!==null)for(const o of r)o.stop();Vg(n),n.f^=Pl,n.f|=mn;var i=n.parent;i!==null&&i.first!==null&&qg(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes=n.ac=n.b=null}function Jg(n,e){for(;n!==null;){var t=n===e?null:ns(n);n.remove(),n=t}}function qg(n){var e=n.parent,t=n.prev,r=n.next;t!==null&&(t.next=r),r!==null&&(r.prev=t),e!==null&&(e.first===n&&(e.first=r),e.last===n&&(e.last=t))}function ei(n,e,t=!0){var r=[];Gg(n,r,!0);var i=()=>{t&&qt(n),e&&e()},o=r.length;if(o>0){var s=()=>--o||i();for(var a of r)a.out(s)}else i()}function Gg(n,e,t){if((n.f&on)===0){n.f^=on;var r=n.nodes&&n.nodes.t;if(r!==null)for(const a of r)(a.is_global||t)&&e.push(a);for(var i=n.first;i!==null;){var o=i.next;if((i.f&zr)===0){var s=(i.f&yr)!==0||(i.f&Un)!==0&&(n.f&Yn)!==0;Gg(i,e,s?t:!1)}i=o}}}function Uu(n){Yg(n,!0)}function Yg(n,e){if((n.f&on)!==0){n.f^=on,(n.f&Rt)===0&&(At(n,Jt),xr.ensure().schedule(n));for(var t=n.first;t!==null;){var r=t.next,i=(t.f&yr)!==0||(t.f&Un)!==0;Yg(t,i?e:!1),t=r}var o=n.nodes&&n.nodes.t;if(o!==null)for(const s of o)(s.is_global||e)&&s.in()}}function ju(n,e){if(n.nodes)for(var t=n.nodes.start,r=n.nodes.end;t!==null;){var i=t===r?null:ns(t);e.append(t),t=i}}let Us=!1,wr=!1;function Uc(n){wr=n}let at=null,Rn=!1;function Nn(n){at=n}let Qe=null;function An(n){Qe=n}let Tn=null;function Zg(n){at!==null&&(Tn===null?Tn=[n]:Tn.push(n))}let sn=null,gn=0,xn=null;function r_(n){xn=n}let Xg=1,Qr=0,ti=Qr;function jc(n){ti=n}function Qg(){return++Xg}function is(n){var e=n.f;if((e&Jt)!==0)return!0;if(e&en&&(n.f&=~si),(e&nr)!==0){for(var t=n.deps,r=t.length,i=0;i<r;i++){var o=t[i];if(is(o)&&Ig(o),o.wv>n.wv)return!0}(e&Cn)!==0&&Ln===null&&At(n,Rt)}return!1}function $g(n,e,t=!0){var r=n.reactions;if(r!==null&&!(Tn!==null&&Qi.call(Tn,n)))for(var i=0;i<r.length;i++){var o=r[i];(o.f&en)!==0?$g(o,e,!1):e===o&&(t?At(o,Jt):(o.f&Rt)!==0&&At(o,nr),Du(o))}}function eh(n){var e=sn,t=gn,r=xn,i=at,o=Tn,s=yt,a=Rn,u=ti,c=n.f;sn=null,gn=0,xn=null,at=(c&(Un|zr))===0?n:null,Tn=null,eo(n.ctx),Rn=!1,ti=++Qr,n.ac!==null&&(xa(()=>{n.ac.abort(pr)}),n.ac=null);try{n.f|=Dl;var d=n.fn,f=d();n.f|=_i;var g=n.deps,p=qe?.is_fork;if(sn!==null){var v;if(p||Wo(n,gn),g!==null&&gn>0)for(g.length=gn+sn.length,v=0;v<sn.length;v++)g[gn+v]=sn[v];else n.deps=g=sn;if(zu()&&(n.f&Cn)!==0)for(v=gn;v<g.length;v++)(g[v].reactions??=[]).push(n)}else!p&&g!==null&&gn<g.length&&(Wo(n,gn),g.length=gn);if(ho()&&xn!==null&&!Rn&&g!==null&&(n.f&(en|nr|Jt))===0)for(v=0;v<xn.length;v++)$g(xn[v],n);if(i!==null&&i!==n){if(Qr++,i.deps!==null)for(let m=0;m<t;m+=1)i.deps[m].rv=Qr;if(e!==null)for(const m of e)m.rv=Qr;xn!==null&&(r===null?r=xn:r.push(...xn))}return(n.f&Ir)!==0&&(n.f^=Ir),f}catch(m){return wg(m)}finally{n.f^=Dl,sn=e,gn=t,xn=r,at=i,Tn=o,eo(s),Rn=a,ti=u}}function i_(n,e){let t=e.reactions;if(t!==null){var r=Zp.call(t,n);if(r!==-1){var i=t.length-1;i===0?t=e.reactions=null:(t[r]=t[i],t.pop())}}if(t===null&&(e.f&en)!==0&&(sn===null||!Qi.call(sn,e))){var o=e;(o.f&Cn)!==0&&(o.f^=Cn,o.f&=~si),o.v!==Dt&&Mu(o),Vm(o),Wo(o,0)}}function Wo(n,e){var t=n.deps;if(t!==null)for(var r=e;r<t.length;r++)i_(n,t[r])}function no(n){var e=n.f;if((e&mn)===0){At(n,Rt);var t=Qe,r=Us;Qe=n,Us=!0;try{(e&(Yn|Eu))!==0?n_(n):Bu(n),Vg(n);var i=eh(n);n.teardown=typeof i=="function"?i:null,n.wv=Xg;var o;Yp&&Nm&&(n.f&Jt)!==0&&n.deps}finally{Us=r,Qe=t}}}async function o_(){await Promise.resolve(),Tg()}function l(n){var e=n.f,t=(e&en)!==0;if(at!==null&&!Rn){var r=Qe!==null&&(Qe.f&mn)!==0;if(!r&&(Tn===null||!Qi.call(Tn,n))){var i=at.deps;if((at.f&Dl)!==0)n.rv<Qr&&(n.rv=Qr,sn===null&&i!==null&&i[gn]===n?gn++:sn===null?sn=[n]:sn.push(n));else{(at.deps??=[]).push(n);var o=n.reactions;o===null?n.reactions=[at]:Qi.call(o,at)||o.push(at)}}}if(wr&&$r.has(n))return $r.get(n);if(t){var s=n;if(wr){var a=s.v;return((s.f&Rt)===0&&s.reactions!==null||nh(s))&&(a=Fu(s)),$r.set(s,a),a}var u=(s.f&Cn)===0&&!Rn&&at!==null&&(Us||(at.f&Cn)!==0),c=(s.f&_i)===0;is(s)&&(u&&(s.f|=Cn),Ig(s)),u&&!c&&(Fg(s),th(s))}if(Ln?.has(n))return Ln.get(n);if((n.f&Ir)!==0)throw n.v;return n.v}function th(n){if(n.f|=Cn,n.deps!==null)for(const e of n.deps)(e.reactions??=[]).push(n),(e.f&en)!==0&&(e.f&Cn)===0&&(Fg(e),th(e))}function nh(n){if(n.v===Dt)return!0;if(n.deps===null)return!1;for(const e of n.deps)if($r.has(e)||(e.f&en)!==0&&nh(e))return!0;return!1}function Yt(n){var e=Rn;try{return Rn=!0,n()}finally{Rn=e}}function Gr(n){if(!(typeof n!="object"||!n||n instanceof EventTarget)){if(Zn in n)zl(n);else if(!Array.isArray(n))for(let e in n){const t=n[e];typeof t=="object"&&t&&Zn in t&&zl(t)}}}function zl(n,e=new Set){if(typeof n=="object"&&n!==null&&!(n instanceof EventTarget)&&!e.has(n)){e.add(n),n instanceof Date&&n.getTime();for(let r in n)try{zl(n[r],e)}catch{}const t=Tu(n);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const r=lg(t);for(let i in r){const o=r[i].get;if(o)try{o.call(n)}catch{}}}}}function s_(n){return n.endsWith("capture")&&n!=="gotpointercapture"&&n!=="lostpointercapture"}const a_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function l_(n){return a_.includes(n)}const u_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function c_(n){return n=n.toLowerCase(),u_[n]??n}const d_=["touchstart","touchmove"];function f_(n){return d_.includes(n)}const No=Symbol("events"),rh=new Set,Bl=new Set;function Wu(n,e,t,r={}){function i(o){if(r.capture||Ul.call(e,o),!o.cancelBubble)return xa(()=>t?.call(this,o))}return n.startsWith("pointer")||n.startsWith("touch")||n==="wheel"?Xn(()=>{e.addEventListener(n,i,r)}):e.addEventListener(n,i,r),i}function Zs(n,e,t,r={}){var i=Wu(e,n,t,r);return()=>{n.removeEventListener(e,i,r)}}function cn(n,e,t,r,i){var o={capture:r,passive:i},s=Wu(n,e,t,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&rs(()=>{e.removeEventListener(n,s,o)})}function ee(n,e,t){(e[No]??={})[n]=t}function ye(n){for(var e=0;e<n.length;e++)rh.add(n[e]);for(var t of Bl)t(n)}let Wc=null;function Ul(n){var e=this,t=e.ownerDocument,r=n.type,i=n.composedPath?.()||[],o=i[0]||n.target;Wc=n;var s=0,a=Wc===n&&n[No];if(a){var u=i.indexOf(a);if(u!==-1&&(e===document||e===window)){n[No]=e;return}var c=i.indexOf(e);if(c===-1)return;u<=c&&(s=u)}if(o=i[s]||n.target,o!==e){ag(n,"currentTarget",{configurable:!0,get(){return o||t}});var d=at,f=Qe;Nn(null),An(null);try{for(var g,p=[];o!==null;){var v=o.assignedSlot||o.parentNode||o.host||null;try{var m=o[No]?.[r];m!=null&&(!o.disabled||n.target===o)&&m.call(o,n)}catch(h){g?p.push(h):g=h}if(n.cancelBubble||v===e||v===null)break;o=v}if(g){for(let h of p)queueMicrotask(()=>{throw h});throw g}}finally{n[No]=e,delete n.currentTarget,Nn(d),An(f)}}}const g_=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:n=>n});function h_(n){return g_?.createHTML(n)??n}function ih(n){var e=Lu("template");return e.innerHTML=h_(n.replaceAll("<!>","<!---->")),e.content}function kr(n,e){var t=Qe;t.nodes===null&&(t.nodes={start:n,end:e,a:null,t:null})}function P(n,e){var t=(e&vg)!==0,r=(e&wm)!==0,i,o=!n.startsWith("<!>");return()=>{i===void 0&&(i=ih(o?n:"<!>"+n),t||(i=vn(i)));var s=r||zg?document.importNode(i,!0):i.cloneNode(!0);if(t){var a=vn(s),u=s.lastChild;kr(a,u)}else kr(s,s);return s}}function v_(n,e,t="svg"){var r=!n.startsWith("<!>"),i=(e&vg)!==0,o=`<${t}>${r?n:"<!>"+n}</${t}>`,s;return()=>{if(!s){var a=ih(o),u=vn(a);if(i)for(s=document.createDocumentFragment();vn(u);)s.appendChild(vn(u));else s=vn(u)}var c=s.cloneNode(!0);if(i){var d=vn(c),f=c.lastChild;kr(d,f)}else kr(c,c);return c}}function ur(n,e){return v_(n,e,"svg")}function ai(n=""){{var e=Qn(n+"");return kr(e,e),e}}function ne(){var n=document.createDocumentFragment(),e=document.createComment(""),t=Qn();return n.append(e,t),kr(e,t),n}function y(n,e){n!==null&&n.before(e)}function $(n,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(n.__t??=n.nodeValue)&&(n.__t=t,n.nodeValue=`${t}`)}function oh(n,e){return p_(n,e)}const ws=new Map;function p_(n,{target:e,anchor:t,props:r={},events:i,context:o,intro:s=!0,transformError:a}){Gm();var u=void 0,c=e_(()=>{var d=t??e.appendChild(Qn());jm(d,{pending:()=>{}},p=>{he({});var v=yt;o&&(v.c=o),i&&(r.$$events=i),u=n(p,r)||{},ve()},a);var f=new Set,g=p=>{for(var v=0;v<p.length;v++){var m=p[v];if(!f.has(m)){f.add(m);var h=f_(m);for(const x of[e,document]){var w=ws.get(x);w===void 0&&(w=new Map,ws.set(x,w));var b=w.get(m);b===void 0?(x.addEventListener(m,Ul,{passive:h}),w.set(m,1)):w.set(m,b+1)}}}};return g(_a(rh)),Bl.add(g),()=>{for(var p of f)for(const h of[e,document]){var v=ws.get(h),m=v.get(p);--m==0?(h.removeEventListener(p,Ul),v.delete(p),v.size===0&&ws.delete(h)):v.set(p,m)}Bl.delete(g),d!==t&&d.parentNode?.removeChild(d)}});return m_.set(u,c),u}let m_=new WeakMap;class os{anchor;#e=new Map;#n=new Map;#t=new Map;#o=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#s=e=>{if(this.#e.has(e)){var t=this.#e.get(e),r=this.#n.get(t);if(r)Uu(r),this.#o.delete(t);else{var i=this.#t.get(t);i&&(this.#n.set(t,i.effect),this.#t.delete(t),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[o,s]of this.#e){if(this.#e.delete(o),o===e)break;const a=this.#t.get(s);a&&(qt(a.effect),this.#t.delete(s))}for(const[o,s]of this.#n){if(o===t||this.#o.has(o))continue;const a=()=>{if(Array.from(this.#e.values()).includes(o)){var c=document.createDocumentFragment();ju(s,c),c.append(Qn()),this.#t.set(o,{effect:s,fragment:c})}else qt(s);this.#o.delete(o),this.#n.delete(o)};this.#i||!r?(this.#o.add(o),ei(s,a,!1)):a()}}};#r=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[r,i]of this.#t)t.includes(r)||(qt(i.effect),this.#t.delete(r))};ensure(e,t){var r=qe,i=jg();if(t&&!this.#n.has(e)&&!this.#t.has(e))if(i){var o=document.createDocumentFragment(),s=Qn();o.append(s),this.#t.set(e,{effect:an(()=>t(s)),fragment:o})}else this.#n.set(e,an(()=>t(this.anchor)));if(this.#e.set(r,e),i){for(const[a,u]of this.#n)a===e?r.unskip_effect(u):r.skip_effect(u);for(const[a,u]of this.#t)a===e?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(this.#s),r.ondiscard(this.#r)}else this.#s(r)}}const __=0,Kc=1,b_=2;function y_(n,e,t,r,i){var o=ho(),s=Dt,a=o?rr(s):Gs(s,!1,!1),u=o?rr(s):Gs(s,!1,!1),c=new os(n);yi(()=>{var d=qe;d.deactivate();var f=e();d.activate();var g=!1;if($p(f)){var p=Og(),v=!1;const m=h=>{if(!g){v=!0,p(!1),xr.ensure();try{h()}finally{Uo(!1),Hi||Tg()}}};f.then(h=>{m(()=>{_r(a,h),c.ensure(Kc,r&&(w=>r(w,a)))})},h=>{m(()=>{if(_r(u,h),c.ensure(b_,i&&(w=>i(w,u))),!i)throw u.v})}),Xn(()=>{v||m(()=>{c.ensure(__,t)})})}else _r(a,f),c.ensure(Kc,r&&(m=>r(m,a)));return()=>{g=!0}})}function K(n,e,t=!1){var r=new os(n),i=t?yr:0;function o(s,a){r.ensure(s,a)}yi(()=>{var s=!1;e((a,u=0)=>{s=!0,o(u,a)}),s||o(-1,null)},i)}function ut(n,e){return e}function x_(n,e,t){for(var r=[],i=e.length,o,s=e.length,a=0;a<i;a++){let f=e[a];ei(f,()=>{if(o){if(o.pending.delete(f),o.done.add(f),o.pending.size===0){var g=n.outrogroups;jl(n,_a(o.done)),g.delete(o),g.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var u=r.length===0&&t!==null;if(u){var c=t,d=c.parentNode;Ym(d),d.append(c),n.items.clear()}jl(n,e,!u)}else o={pending:new Set(e),done:new Set},(n.outrogroups??=new Set).add(o)}function jl(n,e,t=!0){var r;if(n.pending.size>0){r=new Set;for(const s of n.pending.values())for(const a of s)r.add(n.items.get(a).e)}for(var i=0;i<e.length;i++){var o=e[i];if(r?.has(o)){o.f|=Gn;const s=document.createDocumentFragment();ju(o,s)}else qt(e[i],t)}}var Hc;function Ue(n,e,t,r,i,o=null){var s=n,a=new Map,u=(e&gg)!==0;if(u){var c=n;s=c.appendChild(Qn())}var d=null,f=Iu(()=>{var x=t();return Cu(x)?x:x==null?[]:_a(x)}),g,p=new Map,v=!0;function m(x){(b.effect.f&mn)===0&&(b.pending.delete(x),b.fallback=d,w_(b,g,s,e,r),d!==null&&(g.length===0?(d.f&Gn)===0?Uu(d):(d.f^=Gn,Ao(d,null,s)):ei(d,()=>{d=null})))}function h(x){b.pending.delete(x)}var w=yi(()=>{g=l(f);for(var x=g.length,S=new Set,k=qe,C=jg(),N=0;N<x;N+=1){var O=g[N],E=r(O,N),D=v?null:a.get(E);D?(D.v&&_r(D.v,O),D.i&&_r(D.i,N),C&&k.unskip_effect(D.e)):(D=k_(a,v?s:Hc??=Qn(),O,E,N,i,e,t),v||(D.e.f|=Gn),a.set(E,D)),S.add(E)}if(x===0&&o&&!d&&(v?d=an(()=>o(s)):(d=an(()=>o(Hc??=Qn())),d.f|=Gn)),x>S.size&&im(),!v)if(p.set(k,S),C){for(const[L,V]of a)S.has(L)||k.skip_effect(V.e);k.oncommit(m),k.ondiscard(h)}else m(k);l(f)}),b={effect:w,items:a,pending:p,outrogroups:null,fallback:d};v=!1}function ko(n){for(;n!==null&&(n.f&Un)===0;)n=n.next;return n}function w_(n,e,t,r,i){var o=(r&pm)!==0,s=e.length,a=n.items,u=ko(n.effect.first),c,d=null,f,g=[],p=[],v,m,h,w;if(o)for(w=0;w<s;w+=1)v=e[w],m=i(v,w),h=a.get(m).e,(h.f&Gn)===0&&(h.nodes?.a?.measure(),(f??=new Set).add(h));for(w=0;w<s;w+=1){if(v=e[w],m=i(v,w),h=a.get(m).e,n.outrogroups!==null)for(const D of n.outrogroups)D.pending.delete(h),D.done.delete(h);if((h.f&on)!==0&&(Uu(h),o&&(h.nodes?.a?.unfix(),(f??=new Set).delete(h))),(h.f&Gn)!==0)if(h.f^=Gn,h===u)Ao(h,null,t);else{var b=d?d.next:u;h===n.effect.last&&(n.effect.last=h.prev),h.prev&&(h.prev.next=h.next),h.next&&(h.next.prev=h.prev),Nr(n,d,h),Nr(n,h,b),Ao(h,b,t),d=h,g=[],p=[],u=ko(d.next);continue}if(h!==u){if(c!==void 0&&c.has(h)){if(g.length<p.length){var x=p[0],S;d=x.prev;var k=g[0],C=g[g.length-1];for(S=0;S<g.length;S+=1)Ao(g[S],x,t);for(S=0;S<p.length;S+=1)c.delete(p[S]);Nr(n,k.prev,C.next),Nr(n,d,k),Nr(n,C,x),u=x,d=C,w-=1,g=[],p=[]}else c.delete(h),Ao(h,u,t),Nr(n,h.prev,h.next),Nr(n,h,d===null?n.effect.first:d.next),Nr(n,d,h),d=h;continue}for(g=[],p=[];u!==null&&u!==h;)(c??=new Set).add(u),p.push(u),u=ko(u.next);if(u===null)continue}(h.f&Gn)===0&&g.push(h),d=h,u=ko(h.next)}if(n.outrogroups!==null){for(const D of n.outrogroups)D.pending.size===0&&(jl(n,_a(D.done)),n.outrogroups?.delete(D));n.outrogroups.size===0&&(n.outrogroups=null)}if(u!==null||c!==void 0){var N=[];if(c!==void 0)for(h of c)(h.f&on)===0&&N.push(h);for(;u!==null;)(u.f&on)===0&&u!==n.fallback&&N.push(u),u=ko(u.next);var O=N.length;if(O>0){var E=(r&gg)!==0&&s===0?t:null;if(o){for(w=0;w<O;w+=1)N[w].nodes?.a?.measure();for(w=0;w<O;w+=1)N[w].nodes?.a?.fix()}x_(n,N,E)}}o&&Xn(()=>{if(f!==void 0)for(h of f)h.nodes?.a?.apply()})}function k_(n,e,t,r,i,o,s,a){var u=(s&hm)!==0?(s&mm)===0?Gs(t,!1,!1):rr(t):null,c=(s&vm)!==0?rr(i):null;return{v:u,i:c,e:an(()=>(o(e,u??t,c??i,a),()=>{n.delete(r)}))}}function Ao(n,e,t){if(n.nodes)for(var r=n.nodes.start,i=n.nodes.end,o=e&&(e.f&Gn)===0?e.nodes.start:t;r!==null;){var s=ns(r);if(o.before(r),r===i)return;r=s}}function Nr(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function Wl(n,e,t=!1,r=!1,i=!1,o=!1){var s=n,a="";if(t)var u=n;J(()=>{var c=Qe;if(a!==(a=e()??"")){if(t){c.nodes=null,u.innerHTML=a,a!==""&&kr(vn(u),u.lastChild);return}if(c.nodes!==null&&(Jg(c.nodes.start,c.nodes.end),c.nodes=null),a!==""){var d=r?mg:i?km:void 0,f=Lu(r?"svg":i?"math":"template",d);f.innerHTML=a;var g=r||i?f:f.content;if(kr(vn(g),g.lastChild),r||i)for(;vn(g);)s.before(vn(g));else s.before(g)}}})}function Oe(n,e,t,r,i){var o=e.$$slots?.[t],s=!1;o===!0&&(o=e.children,s=!0),o===void 0||o(n,s?()=>r:r)}function It(n,e,...t){var r=new os(n);yi(()=>{const i=e()??null;r.ensure(i,i&&(o=>i(o,...t)))},yr)}function Qt(n,e,t){var r=new os(n);yi(()=>{var i=e()??null;r.ensure(i,i&&(o=>t(o,i)))},yr)}function S_(n,e,t,r,i,o){var s=null,a=n,u=new os(a,!1);yi(()=>{const c=e()||null;var d=mg;if(c===null){u.ensure(null,null);return}return u.ensure(c,f=>{if(c){if(s=Lu(c,d),kr(s,s),r){var g=s.appendChild(Qn());r(s,g)}Qe.nodes.end=s,f.before(s)}}),()=>{}},yr),rs(()=>{})}function C_(n,e){var t=void 0,r;Hg(()=>{t!==(t=e())&&(r&&(qt(r),r=null),t&&(r=an(()=>{wa(()=>t(n))})))})}function sh(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=sh(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function T_(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=sh(n))&&(r&&(r+=" "),r+=e);return r}function wt(n){return typeof n=="object"?T_(n):n??""}const Vc=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function E_(n,e,t){var r=n==null?"":""+n;if(e&&(r=r?r+" "+e:e),t){for(var i of Object.keys(t))if(t[i])r=r?r+" "+i:i;else if(r.length)for(var o=i.length,s=0;(s=r.indexOf(i,s))>=0;){var a=s+o;(s===0||Vc.includes(r[s-1]))&&(a===r.length||Vc.includes(r[a]))?r=(s===0?"":r.substring(0,s))+r.substring(a+1):s=a}}return r===""?null:r}function Jc(n,e=!1){var t=e?" !important;":";",r="";for(var i of Object.keys(n)){var o=n[i];o!=null&&o!==""&&(r+=" "+i+": "+o+t)}return r}function $a(n){return n[0]!=="-"||n[1]!=="-"?n.toLowerCase():n}function N_(n,e){if(e){var t="",r,i;if(Array.isArray(e)?(r=e[0],i=e[1]):r=e,n){n=String(n).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,a=!1,u=[];r&&u.push(...Object.keys(r).map($a)),i&&u.push(...Object.keys(i).map($a));var c=0,d=-1;const m=n.length;for(var f=0;f<m;f++){var g=n[f];if(a?g==="/"&&n[f-1]==="*"&&(a=!1):o?o===g&&(o=!1):g==="/"&&n[f+1]==="*"?a=!0:g==='"'||g==="'"?o=g:g==="("?s++:g===")"&&s--,!a&&o===!1&&s===0){if(g===":"&&d===-1)d=f;else if(g===";"||f===m-1){if(d!==-1){var p=$a(n.substring(c,d).trim());if(!u.includes(p)){g!==";"&&f++;var v=n.substring(c,f).trim();t+=" "+v+";"}}c=f+1,d=-1}}}}return r&&(t+=Jc(r)),i&&(t+=Jc(i,!0)),t=t.trim(),t===""?null:t}return n==null?null:String(n)}function Ee(n,e,t,r,i,o){var s=n.__className;if(s!==t||s===void 0){var a=E_(t,r,o);a==null?n.removeAttribute("class"):e?n.className=a:n.setAttribute("class",a),n.__className=t}else if(o&&i!==o)for(var u in o){var c=!!o[u];(i==null||c!==!!i[u])&&n.classList.toggle(u,c)}return o}function el(n,e={},t,r){for(var i in t){var o=t[i];e[i]!==o&&(t[i]==null?n.style.removeProperty(i):n.style.setProperty(i,o,r))}}function zn(n,e,t,r){var i=n.__style;if(i!==e){var o=N_(e,r);o==null?n.removeAttribute("style"):n.style.cssText=o,n.__style=e}else r&&(Array.isArray(r)?(el(n,t?.[0],r[0]),el(n,t?.[1],r[1],"important")):el(n,t,r));return r}function Ko(n,e,t=!1){if(n.multiple){if(e==null)return;if(!Cu(e))return Tm();for(var r of n.options)r.selected=e.includes(Do(r));return}for(r of n.options){var i=Do(r);if(qm(i,e)){r.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function Ku(n){var e=new MutationObserver(()=>{Ko(n,n.__value)});e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),rs(()=>{e.disconnect()})}function ah(n,e,t=e){var r=new WeakSet,i=!0;Ru(n,"change",o=>{var s=o?"[selected]":":checked",a;if(n.multiple)a=[].map.call(n.querySelectorAll(s),Do);else{var u=n.querySelector(s)??n.querySelector("option:not([disabled])");a=u&&Do(u)}t(a),n.__value=a,qe!==null&&r.add(qe)}),wa(()=>{var o=e();if(n===document.activeElement){var s=qe;if(r.has(s))return}if(Ko(n,o,i),i&&o===void 0){var a=n.querySelector(":checked");a!==null&&(o=Do(a),t(o))}n.__value=o,i=!1}),Ku(n)}function Do(n){return"__value"in n?n.__value:n.value}const So=Symbol("class"),Ii=Symbol("style"),lh=Symbol("is custom element"),uh=Symbol("is html"),A_=Nu?"option":"OPTION",M_=Nu?"select":"SELECT",P_=Nu?"progress":"PROGRESS";function ir(n,e){var t=Sa(n);t.value===(t.value=e??void 0)||n.value===e&&(e!==0||n.nodeName!==P_)||(n.value=e??"")}function O_(n,e){var t=Sa(n);t.checked!==(t.checked=e??void 0)&&(n.checked=e)}function D_(n,e){e?n.hasAttribute("selected")||n.setAttribute("selected",""):n.removeAttribute("selected")}function X(n,e,t,r){var i=Sa(n);i[e]!==(i[e]=t)&&(e==="loading"&&(n[nm]=t),t==null?n.removeAttribute(e):typeof t!="string"&&ch(n).includes(e)?n[e]=t:n.setAttribute(e,t))}function I_(n,e,t,r,i=!1,o=!1){var s=Sa(n),a=s[lh],u=!s[uh],c=e||{},d=n.nodeName===A_;for(var f in e)f in t||(t[f]=null);t.class?t.class=wt(t.class):(r||t[So])&&(t.class=null),t[Ii]&&(t.style??=null);var g=ch(n);for(const S in t){let k=t[S];if(d&&S==="value"&&k==null){n.value=n.__value="",c[S]=k;continue}if(S==="class"){var p=n.namespaceURI==="http://www.w3.org/1999/xhtml";Ee(n,p,k,r,e?.[So],t[So]),c[S]=k,c[So]=t[So];continue}if(S==="style"){zn(n,k,e?.[Ii],t[Ii]),c[S]=k,c[Ii]=t[Ii];continue}var v=c[S];if(!(k===v&&!(k===void 0&&n.hasAttribute(S)))){c[S]=k;var m=S[0]+S[1];if(m!=="$$")if(m==="on"){const C={},N="$$"+S;let O=S.slice(2);var h=l_(O);if(s_(O)&&(O=O.slice(0,-7),C.capture=!0),!h&&v){if(k!=null)continue;n.removeEventListener(O,c[N],C),c[N]=null}if(h)ee(O,n,k),ye([O]);else if(k!=null){let E=function(D){c[S].call(this,D)};var x=E;c[N]=Wu(O,n,E,C)}}else if(S==="style")X(n,S,k);else if(S==="autofocus")Zm(n,!!k);else if(!a&&(S==="__value"||S==="value"&&k!=null))n.value=n.__value=k;else if(S==="selected"&&d)D_(n,k);else{var w=S;u||(w=c_(w));var b=w==="defaultValue"||w==="defaultChecked";if(k==null&&!a&&!b)if(s[S]=null,w==="value"||w==="checked"){let C=n;const N=e===void 0;if(w==="value"){let O=C.defaultValue;C.removeAttribute(w),C.defaultValue=O,C.value=C.__value=N?O:null}else{let O=C.defaultChecked;C.removeAttribute(w),C.defaultChecked=O,C.checked=N?O:!1}}else n.removeAttribute(S);else b||g.includes(w)&&(a||typeof k!="string")?(n[w]=k,w in s&&(s[w]=Dt)):typeof k!="function"&&X(n,w,k)}}}return c}function Kl(n,e,t=[],r=[],i=[],o,s=!1,a=!1){Pg(i,t,r,u=>{var c=void 0,d={},f=n.nodeName===M_,g=!1;if(Hg(()=>{var v=e(...u.map(l)),m=I_(n,c,v,o,s,a);g&&f&&"value"in v&&Ko(n,v.value);for(let w of Object.getOwnPropertySymbols(d))v[w]||qt(d[w]);for(let w of Object.getOwnPropertySymbols(v)){var h=v[w];w.description===Sm&&(!c||h!==c[w])&&(d[w]&&qt(d[w]),d[w]=an(()=>C_(n,()=>h))),m[w]=h}c=m}),f){var p=n;wa(()=>{Ko(p,c.value,!0),Ku(p)})}g=!0})}function Sa(n){return n.__attributes??={[lh]:n.nodeName.includes("-"),[uh]:n.namespaceURI===pg}}var qc=new Map;function ch(n){var e=n.getAttribute("is")||n.nodeName,t=qc.get(e);if(t)return t;qc.set(e,t=[]);for(var r,i=n,o=Element.prototype;o!==i;){r=lg(i);for(var s in r)r[s].set&&t.push(s);i=Tu(i)}return t}function Mt(n,e,t=e){var r=new WeakSet;Ru(n,"input",async i=>{var o=i?n.defaultValue:n.value;if(o=tl(n)?nl(o):o,t(o),qe!==null&&r.add(qe),await o_(),o!==(o=e())){var s=n.selectionStart,a=n.selectionEnd,u=n.value.length;if(n.value=o??"",a!==null){var c=n.value.length;s===a&&a===u&&c>u?(n.selectionStart=c,n.selectionEnd=c):(n.selectionStart=s,n.selectionEnd=Math.min(a,c))}}}),Yt(e)==null&&n.value&&(t(tl(n)?nl(n.value):n.value),qe!==null&&r.add(qe)),ka(()=>{var i=e();if(n===document.activeElement){var o=qe;if(r.has(o))return}tl(n)&&i===nl(n.value)||n.type==="date"&&!i&&!n.value||i!==n.value&&(n.value=i??"")})}function Hu(n,e,t=e){Ru(n,"change",r=>{var i=r?n.defaultChecked:n.checked;t(i)}),Yt(e)==null&&t(n.checked),ka(()=>{var r=e();n.checked=!!r})}function tl(n){var e=n.type;return e==="number"||e==="range"}function nl(n){return n===""?null:+n}function Gc(n,e){return n===e||n?.[Zn]===e}function Mn(n={},e,t,r){var i=yt.r,o=Qe;return wa(()=>{var s,a;return ka(()=>{s=a,a=[],Yt(()=>{n!==t(...a)&&(e(n,...a),s&&Gc(t(...s),n)&&e(null,...s))})}),()=>{let u=o;for(;u!==i&&u.parent!==null&&u.parent.f&Pl;)u=u.parent;const c=()=>{a&&Gc(t(...a),n)&&e(null,...a)},d=u.teardown;u.teardown=()=>{c(),d?.()}}}),n}function ss(n=!1){const e=yt,t=e.l.u;if(!t)return;let r=()=>Gr(e.s);if(n){let i=0,o={};const s=ts(()=>{let a=!1;const u=e.s;for(const c in u)u[c]!==o[c]&&(o[c]=u[c],a=!0);return a&&i++,i});r=()=>l(s)}t.b.length&&$m(()=>{Yc(e,r),Al(t.b)}),gt(()=>{const i=Yt(()=>t.m.map(em));return()=>{for(const o of i)typeof o=="function"&&o()}}),t.a.length&>(()=>{Yc(e,r),Al(t.a)})}function Yc(n,e){if(n.l.s)for(const t of n.l.s)l(t);e()}const F_={get(n,e){if(!n.exclude.includes(e))return n.props[e]},set(n,e){return!1},getOwnPropertyDescriptor(n,e){if(!n.exclude.includes(e)&&e in n.props)return{enumerable:!0,configurable:!0,value:n.props[e]}},has(n,e){return n.exclude.includes(e)?!1:e in n.props},ownKeys(n){return Reflect.ownKeys(n.props).filter(e=>!n.exclude.includes(e))}};function dh(n,e,t){return new Proxy({props:n,exclude:e},F_)}const L_={get(n,e){if(!n.exclude.includes(e))return l(n.version),e in n.special?n.special[e]():n.props[e]},set(n,e,t){if(!(e in n.special)){var r=Qe;try{An(n.parent_effect),n.special[e]=se({get[e](){return n.props[e]}},e,hg)}finally{An(r)}}return n.special[e](t),Ys(n.version),!0},getOwnPropertyDescriptor(n,e){if(!n.exclude.includes(e)&&e in n.props)return{enumerable:!0,configurable:!0,value:n.props[e]}},deleteProperty(n,e){return n.exclude.includes(e)||(n.exclude.push(e),Ys(n.version)),!0},has(n,e){return n.exclude.includes(e)?!1:e in n.props},ownKeys(n){return Reflect.ownKeys(n.props).filter(e=>!n.exclude.includes(e))}};function Pe(n,e){return new Proxy({props:n,exclude:e,special:{},version:rr(0),parent_effect:Qe},L_)}const R_={get(n,e){let t=n.props.length;for(;t--;){let r=n.props[t];if(wo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(n,e,t){let r=n.props.length;for(;r--;){let i=n.props[r];wo(i)&&(i=i());const o=Dr(i,e);if(o&&o.set)return o.set(t),!0}return!1},getOwnPropertyDescriptor(n,e){let t=n.props.length;for(;t--;){let r=n.props[t];if(wo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const i=Dr(r,e);return i&&!i.configurable&&(i.configurable=!0),i}}},has(n,e){if(e===Zn||e===fg)return!1;for(let t of n.props)if(wo(t)&&(t=t()),t!=null&&e in t)return!0;return!1},ownKeys(n){const e=[];for(let t of n.props)if(wo(t)&&(t=t()),!!t){for(const r in t)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(t))e.includes(r)||e.push(r)}return e}};function Me(...n){return new Proxy({props:n},R_)}function se(n,e,t,r){var i=!go||(t&bm)!==0,o=(t&ym)!==0,s=(t&xm)!==0,a=r,u=!0,c=()=>(u&&(u=!1,a=s?Yt(r):r),a);let d;if(o){var f=Zn in n||fg in n;d=Dr(n,e)?.set??(f&&e in n?x=>n[e]=x:void 0)}var g,p=!1;o?[g,p]=Rm(()=>n[e]):g=n[e],g===void 0&&r!==void 0&&(g=c(),d&&(i&&um(),d(g)));var v;if(i?v=()=>{var x=n[e];return x===void 0?c():(u=!0,x)}:v=()=>{var x=n[e];return x!==void 0&&(a=void 0),x===void 0?a:x},i&&(t&hg)===0)return v;if(d){var m=n.$$legacy;return(function(x,S){return arguments.length>0?((!i||!S||m||p)&&d(S?v():x),x):v()})}var h=!1,w=((t&_m)!==0?ts:Iu)(()=>(h=!1,v()));o&&l(w);var b=Qe;return(function(x,S){if(arguments.length>0){const k=S?l(w):i&&o?We(x):x;return A(w,k),h=!0,a!==void 0&&(a=k),x}return wr&&h||(b.f&mn)!==0?w.v:l(w)})}function _t(n){yt===null&&Au(),go&&yt.l!==null?B_(yt).m.push(n):gt(()=>{const e=Yt(n);if(typeof e=="function")return e})}function z_(n){yt===null&&Au(),_t(()=>()=>Yt(n))}function B_(n){var e=n.l;return e.u??={a:[],b:[],m:[]}}const U_="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(U_);const j_=Array(12).fill(0);var W_=P('<div class="sonner-loading-bar"></div>'),K_=P('<div><div class="sonner-spinner"></div></div>');function H_(n,e){he(e,!0);var t=K_(),r=_(t);Ue(r,23,()=>j_,(i,o)=>`spinner-bar-${o}`,(i,o)=>{var s=W_();y(i,s)}),J(i=>{Ee(t,1,i),X(t,"data-visible",e.visible)},[()=>wt(["sonner-loading-wrapper",e.class].filter(Boolean).join(" "))]),y(n,t),ve()}function Vn(...n){return n.filter(Boolean).join(" ")}const V_=typeof document<"u",J_=typeof window<"u"?window:void 0;function q_(n){let e=n.activeElement;for(;e?.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}class G_{#e;#n;constructor(e={}){const{window:t=J_,document:r=t?.document}=e;t!==void 0&&(this.#e=r,this.#n=Mg(i=>{const o=Zs(t,"focusin",i),s=Zs(t,"focusout",i);return()=>{o(),s()}}))}get current(){return this.#n?.(),this.#e?q_(this.#e):null}}new G_;class Y_{#e;#n;constructor(e){this.#e=e,this.#n=Symbol(e)}get key(){return this.#n}exists(){return Mm(this.#n)}get(){const e=to(this.#n);if(e===void 0)throw new Error(`Context "${this.#e}" not found`);return e}getOr(e){const t=to(this.#n);return t===void 0?e:t}set(e){return bi(this.#n,e)}}const Z_=new Y_("<Toaster/>");let Zc=0;class X_{#e=Q(We([]));get toasts(){return l(this.#e)}set toasts(e){A(this.#e,e,!0)}#n=Q(We([]));get heights(){return l(this.#n)}set heights(e){A(this.#n,e,!0)}#t=e=>{const t=this.toasts.findIndex(r=>r.id===e);return t===-1?null:t};addToast=e=>{V_&&this.toasts.unshift(e)};updateToast=({id:e,data:t,type:r,message:i})=>{const o=this.toasts.findIndex(a=>a.id===e),s=this.toasts[o];this.toasts[o]={...s,...t,id:e,title:i,type:r,updated:!0}};create=e=>{const{message:t,...r}=e,i=typeof e?.id=="number"||e.id&&e.id?.length>0?e.id:Zc++,o=e.dismissible!==void 0?e.dismissible:e.dismissable!==void 0?e.dismissable:!0,s=e.type===void 0?"default":e.type;return Yt(()=>{this.toasts.find(u=>u.id===i)?this.updateToast({id:i,data:e,type:s,message:t,dismissible:o}):this.addToast({...r,id:i,title:t,dismissible:o,type:s})}),i};dismiss=e=>(Yt(()=>{if(e===void 0){this.toasts=this.toasts.map(r=>({...r,dismiss:!0}));return}const t=this.toasts.findIndex(r=>r.id===e);this.toasts[t]&&(this.toasts[t]={...this.toasts[t],dismiss:!0})}),e);remove=e=>{if(e===void 0){this.toasts=[];return}const t=this.#t(e);if(t!==null)return this.toasts.splice(t,1),e};message=(e,t)=>this.create({...t,type:"default",message:e});error=(e,t)=>this.create({...t,type:"error",message:e});success=(e,t)=>this.create({...t,type:"success",message:e});info=(e,t)=>this.create({...t,type:"info",message:e});warning=(e,t)=>this.create({...t,type:"warning",message:e});loading=(e,t)=>this.create({...t,type:"loading",message:e});promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:typeof t.loading=="string"?t.loading:t.loading()}));const i=e instanceof Promise?e:e();let o=r!==void 0;return i.then(s=>{if(typeof s=="object"&&s&&"ok"in s&&typeof s.ok=="boolean"&&!s.ok){o=!1;const a=Q_(s);this.create({id:r,type:"error",message:a})}else if(t.success!==void 0){o=!1;const a=typeof t.success=="function"?t.success(s):t.success;this.create({id:r,type:"success",message:a})}}).catch(s=>{if(t.error!==void 0){o=!1;const a=typeof t.error=="function"?t.error(s):t.error;this.create({id:r,type:"error",message:a})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),t.finally?.()}),r};custom=(e,t)=>{const r=t?.id||Zc++;return this.create({component:e,id:r,...t}),r};removeHeight=e=>{this.heights=this.heights.filter(t=>t.toastId!==e)};setHeight=e=>{const t=this.#t(e.toastId);if(t===null){this.heights.push(e);return}this.heights[t]=e};reset=()=>{this.toasts=[],this.heights=[]}}function Q_(n){return n&&typeof n=="object"&&"status"in n?`HTTP error! Status: ${n.status}`:`Error! ${n}`}const vt=new X_;function $_(n,e){return vt.create({message:n,...e})}class eb{#e=z(()=>vt.toasts.filter(e=>!e.dismiss));get toasts(){return l(this.#e)}}const tb=$_,Ke=Object.assign(tb,{success:vt.success,info:vt.info,warning:vt.warning,error:vt.error,custom:vt.custom,message:vt.message,promise:vt.promise,dismiss:vt.dismiss,loading:vt.loading,getActiveToasts:()=>vt.toasts.filter(n=>!n.dismiss)});function ks(n){return n.label!==void 0}function nb(){let n=Q(We(typeof document<"u"?document.hidden:!1));return gt(()=>Zs(document,"visibilitychange",()=>{A(n,document.hidden,!0)})),{get current(){return l(n)}}}const Xc=4e3,rb=14,ib=45,ob=200,sb=.05,ab={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function lb(n){const[e,t]=n.split("-"),r=[];return e&&r.push(e),t&&r.push(t),r}function Qc(n){return 1/(1.5+Math.abs(n)/20)}var ub=P("<div><!></div>"),cb=P('<button data-close-button=""><!></button>'),db=P('<div data-icon=""><!> <!></div>'),fb=P('<div data-description=""><!></div>'),gb=P('<button data-button="" data-cancel=""> </button>'),hb=P('<button data-button=""> </button>'),vb=P('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pb=P('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function mb(n,e){he(e,!0);const t=fe=>{var te=ne(),ae=q(te);{var me=pe=>{var Te=ub(),Be=_(Te);It(Be,()=>e.loadingIcon),J(dt=>{Ee(Te,1,dt),X(Te,"data-visible",l(C)==="loading")},[()=>wt(Vn(l(W)?.loader,e.toast?.classes?.loader,"sonner-loader"))]),y(pe,Te)},ce=pe=>{{let Te=z(()=>Vn(l(W)?.loader,e.toast.classes?.loader)),Be=z(()=>l(C)==="loading");H_(pe,{get class(){return l(Te)},get visible(){return l(Be)}})}};K(ae,pe=>{e.loadingIcon?pe(me):pe(ce,-1)})}y(fe,te)};let r=se(e,"cancelButtonStyle",3,""),i=se(e,"actionButtonStyle",3,""),o=se(e,"descriptionClass",3,""),s=se(e,"unstyled",3,!1),a=se(e,"defaultRichColors",3,!1);const u={...ab};let c=Q(!1),d=Q(!1),f=Q(!1),g=Q(!1),p=Q(!1),v=Q(0),m=Q(0),h=e.toast.duration||e.duration||Xc,w=Q(void 0),b=Q(null),x=Q(null);const S=z(()=>e.index===0),k=z(()=>e.index+1<=e.visibleToasts),C=z(()=>e.toast.type),N=z(()=>e.toast.dismissible!==void 0?e.toast.dismissible!==!1:e.toast.dismissable!==!1),O=z(()=>e.toast.class||""),E=z(()=>e.toast.descriptionClass||""),D=z(()=>vt.heights.findIndex(fe=>fe.toastId===e.toast.id)||0),L=z(()=>e.toast.closeButton??e.closeButton),V=z(()=>e.toast.duration??e.duration??Xc);let G=null;const U=z(()=>e.position.split("-")),M=z(()=>vt.heights.reduce((fe,te,ae)=>ae>=l(D)?fe:fe+te.height,0)),j=nb(),Y=z(()=>e.toast.invert||e.invert),Z=z(()=>l(C)==="loading"),W=z(()=>({...u,...e.classes})),H=z(()=>e.toast.title),ie=z(()=>e.toast.description);let I=Q(0),F=Q(0);const R=z(()=>Math.round(l(D)*rb+l(M)));gt(()=>{l(H),l(ie);let fe;e.expanded||e.expandByDefault?fe=1:fe=1-e.index*sb;const te=Yt(()=>l(w));if(te===void 0)return;te.style.setProperty("height","auto");const ae=te.offsetHeight,me=te.getBoundingClientRect().height,ce=Math.round(me/fe+Number.EPSILON&100)/100;te.style.removeProperty("height");let pe;Math.abs(ce-ae)<1?pe=ce:pe=ae,A(m,pe,!0),vt.setHeight({toastId:e.toast.id,height:pe})});function B(){A(d,!0),A(v,l(R),!0),vt.removeHeight(e.toast.id),setTimeout(()=>{vt.remove(e.toast.id)},ob)}let re;const le=z(()=>e.toast.promise&&l(C)==="loading"||e.toast.duration===Number.POSITIVE_INFINITY);function ke(){A(I,new Date().getTime(),!0),re=setTimeout(()=>{e.toast.onAutoClose?.(e.toast),B()},h)}function Ae(){if(l(F)<l(I)){const fe=new Date().getTime()-l(I);h=h-fe}A(F,new Date().getTime(),!0)}gt(()=>{e.toast.updated&&(clearTimeout(re),h=l(V),ke())}),gt(()=>(l(le)||(e.expanded||e.interacting||e.pauseWhenPageIsHidden&&j.current?Ae():ke()),()=>clearTimeout(re))),_t(()=>{A(c,!0);const fe=l(w)?.getBoundingClientRect().height;return A(m,fe,!0),vt.setHeight({toastId:e.toast.id,height:fe}),()=>{vt.removeHeight(e.toast.id)}}),gt(()=>{e.toast.delete&&Yt(()=>{B(),e.toast.onDismiss?.(e.toast)})});const we=fe=>{if(l(Z))return;A(v,l(R),!0);const te=fe.target;te.setPointerCapture(fe.pointerId),te.tagName!=="BUTTON"&&(A(f,!0),G={x:fe.clientX,y:fe.clientY})},_e=()=>{if(l(g)||!l(N))return;G=null;const fe=Number(l(w)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),te=Number(l(w)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),ae=new Date().getTime()-0,me=l(b)==="x"?fe:te,ce=Math.abs(me)/ae;if(Math.abs(me)>=ib||ce>.11){A(v,l(R),!0),e.toast.onDismiss?.(e.toast),l(b)==="x"?A(x,fe>0?"right":"left",!0):A(x,te>0?"down":"up",!0),B(),A(g,!0);return}else l(w)?.style.setProperty("--swipe-amount-x","0px"),l(w)?.style.setProperty("--swipe-amount-y","0px");A(p,!1),A(f,!1),A(b,null)},Ce=fe=>{if(!G||!l(N)||(window.getSelection()?.toString().length??-1)>0)return;const ae=fe.clientY-G.y,me=fe.clientX-G.x,ce=e.swipeDirections??lb(e.position);!l(b)&&(Math.abs(me)>1||Math.abs(ae)>1)&&A(b,Math.abs(me)>Math.abs(ae)?"x":"y",!0);let pe={x:0,y:0};if(l(b)==="y"){if(ce.includes("top")||ce.includes("bottom"))if(ce.includes("top")&&ae<0||ce.includes("bottom")&&ae>0)pe.y=ae;else{const Te=ae*Qc(ae);pe.y=Math.abs(Te)<Math.abs(ae)?Te:ae}}else if(l(b)==="x"&&(ce.includes("left")||ce.includes("right")))if(ce.includes("left")&&me<0||ce.includes("right")&&me>0)pe.x=me;else{const Te=me*Qc(me);pe.x=Math.abs(Te)<Math.abs(me)?Te:me}(Math.abs(pe.x)>0||Math.abs(pe.y)>0)&&A(p,!0),l(w)?.style.setProperty("--swipe-amount-x",`${pe.x}px`),l(w)?.style.setProperty("--swipe-amount-y",`${pe.y}px`)},xe=()=>{A(f,!1),A(b,null),G=null},Fe=z(()=>e.toast.icon?e.toast.icon:l(C)==="success"?e.successIcon:l(C)==="error"?e.errorIcon:l(C)==="warning"?e.warningIcon:l(C)==="info"?e.infoIcon:l(C)==="loading"?e.loadingIcon:null);var ge=pb();X(ge,"tabindex",0);let Ve;var He=_(ge);{var tt=fe=>{var te=cb(),ae=_(te);It(ae,()=>e.closeIcon??Nt),J(me=>{X(te,"aria-label",e.closeButtonAriaLabel),X(te,"data-disabled",l(Z)),Ee(te,1,me)},[()=>wt(Vn(l(W)?.closeButton,e.toast?.classes?.closeButton))]),ee("click",te,()=>{l(Z)||!l(N)||(B(),e.toast.onDismiss?.(e.toast))}),y(fe,te)};K(He,fe=>{l(L)&&!e.toast.component&&l(C)!=="loading"&&e.closeIcon!==null&&fe(tt)})}var rt=T(He,2);{var Ie=fe=>{const te=z(()=>e.toast.component);var ae=ne(),me=q(ae);Qt(me,()=>l(te),(ce,pe)=>{pe(ce,Me(()=>e.toast.componentProps,{closeToast:B}))}),y(fe,ae)},ze=fe=>{var te=vb(),ae=q(te);{var me=je=>{var Ge=db(),Re=_(Ge);{var st=et=>{var nt=ne(),Wt=q(nt);{var Ot=Er=>{var ys=ne(),Xa=q(ys);Qt(Xa,()=>e.toast.icon,(Kt,Xt)=>{Xt(Kt,{})}),y(Er,ys)},In=Er=>{t(Er)};K(Wt,Er=>{e.toast.icon?Er(Ot):Er(In,-1)})}y(et,nt)};K(Re,et=>{(e.toast.promise||l(C)==="loading")&&et(st)})}var Tt=T(Re,2);{var pt=et=>{var nt=ne(),Wt=q(nt);{var Ot=Kt=>{var Xt=ne(),cr=q(Xt);Qt(cr,()=>e.toast.icon,(qp,Gp)=>{Gp(qp,{})}),y(Kt,Xt)},In=Kt=>{var Xt=ne(),cr=q(Xt);It(cr,()=>e.successIcon??Nt),y(Kt,Xt)},Er=Kt=>{var Xt=ne(),cr=q(Xt);It(cr,()=>e.errorIcon??Nt),y(Kt,Xt)},ys=Kt=>{var Xt=ne(),cr=q(Xt);It(cr,()=>e.warningIcon??Nt),y(Kt,Xt)},Xa=Kt=>{var Xt=ne(),cr=q(Xt);It(cr,()=>e.infoIcon??Nt),y(Kt,Xt)};K(Wt,Kt=>{e.toast.icon?Kt(Ot):l(C)==="success"?Kt(In,1):l(C)==="error"?Kt(Er,2):l(C)==="warning"?Kt(ys,3):l(C)==="info"&&Kt(Xa,4)})}y(et,nt)};K(Tt,et=>{e.toast.type!=="loading"&&et(pt)})}J(et=>Ee(Ge,1,et),[()=>wt(Vn(l(W)?.icon,e.toast?.classes?.icon))]),y(je,Ge)};K(ae,je=>{(l(C)||e.toast.icon||e.toast.promise)&&e.toast.icon!==null&&(l(Fe)!==null||e.toast.icon)&&je(me)})}var ce=T(ae,2),pe=_(ce),Te=_(pe);{var Be=je=>{var Ge=ne(),Re=q(Ge);{var st=pt=>{const et=z(()=>e.toast.title);var nt=ne(),Wt=q(nt);Qt(Wt,()=>l(et),(Ot,In)=>{In(Ot,Me(()=>e.toast.componentProps))}),y(pt,nt)},Tt=pt=>{var et=ai();J(()=>$(et,e.toast.title)),y(pt,et)};K(Re,pt=>{typeof e.toast.title!="string"?pt(st):pt(Tt,-1)})}y(je,Ge)};K(Te,je=>{e.toast.title&&je(Be)})}var dt=T(pe,2);{var Ze=je=>{var Ge=fb(),Re=_(Ge);{var st=pt=>{const et=z(()=>e.toast.description);var nt=ne(),Wt=q(nt);Qt(Wt,()=>l(et),(Ot,In)=>{In(Ot,Me(()=>e.toast.componentProps))}),y(pt,nt)},Tt=pt=>{var et=ai();J(()=>$(et,e.toast.description)),y(pt,et)};K(Re,pt=>{typeof e.toast.description!="string"?pt(st):pt(Tt,-1)})}J(pt=>Ee(Ge,1,pt),[()=>wt(Vn(o(),l(E),l(W)?.description,e.toast.classes?.description))]),y(je,Ge)};K(dt,je=>{e.toast.description&&je(Ze)})}var it=T(ce,2);{var $e=je=>{var Ge=ne(),Re=q(Ge);{var st=et=>{var nt=ne(),Wt=q(nt);Qt(Wt,()=>e.toast.cancel,(Ot,In)=>{In(Ot,{})}),y(et,nt)},Tt=et=>{var nt=gb(),Wt=_(nt);J(Ot=>{zn(nt,e.toast.cancelButtonStyle??r()),Ee(nt,1,Ot),$(Wt,e.toast.cancel.label)},[()=>wt(Vn(l(W)?.cancelButton,e.toast?.classes?.cancelButton))]),ee("click",nt,Ot=>{ks(e.toast.cancel)&&l(N)&&(e.toast.cancel?.onClick?.(Ot),B())}),y(et,nt)},pt=z(()=>ks(e.toast.cancel));K(Re,et=>{typeof e.toast.cancel=="function"?et(st):l(pt)&&et(Tt,1)})}y(je,Ge)};K(it,je=>{e.toast.cancel&&je($e)})}var Je=T(it,2);{var ot=je=>{var Ge=ne(),Re=q(Ge);{var st=et=>{var nt=ne(),Wt=q(nt);Qt(Wt,()=>e.toast.action,(Ot,In)=>{In(Ot,{})}),y(et,nt)},Tt=et=>{var nt=hb(),Wt=_(nt);J(Ot=>{zn(nt,e.toast.actionButtonStyle??i()),Ee(nt,1,Ot),$(Wt,e.toast.action.label)},[()=>wt(Vn(l(W)?.actionButton,e.toast?.classes?.actionButton))]),ee("click",nt,Ot=>{ks(e.toast.action)&&(e.toast.action?.onClick(Ot),!Ot.defaultPrevented&&B())}),y(et,nt)},pt=z(()=>ks(e.toast.action));K(Re,et=>{typeof e.toast.action=="function"?et(st):l(pt)&&et(Tt,1)})}y(je,Ge)};K(Je,je=>{e.toast.action&&je(ot)})}J((je,Ge)=>{Ee(ce,1,je),Ee(pe,1,Ge)},[()=>wt(Vn(l(W)?.content,e.toast?.classes?.content)),()=>wt(Vn(l(W)?.title,e.toast?.classes?.title))]),y(fe,te)};K(rt,fe=>{e.toast.component?fe(Ie):fe(ze,-1)})}Mn(ge,fe=>A(w,fe),()=>l(w)),J((fe,te,ae)=>{Ee(ge,1,fe),X(ge,"aria-live",e.toast.important?"assertive":"polite"),X(ge,"data-rich-colors",e.toast.richColors??a()),X(ge,"data-styled",!(e.toast.component||e.toast.unstyled||s())),X(ge,"data-mounted",l(c)),X(ge,"data-promise",te),X(ge,"data-swiped",l(p)),X(ge,"data-removed",l(d)),X(ge,"data-visible",l(k)),X(ge,"data-y-position",l(U)[0]),X(ge,"data-x-position",l(U)[1]),X(ge,"data-index",e.index),X(ge,"data-front",l(S)),X(ge,"data-swiping",l(f)),X(ge,"data-dismissible",l(N)),X(ge,"data-type",l(C)),X(ge,"data-invert",l(Y)),X(ge,"data-swipe-out",l(g)),X(ge,"data-swipe-direction",l(x)),X(ge,"data-expanded",ae),Ve=zn(ge,`${e.style} ${e.toast.style}`,Ve,{"--index":e.index,"--toasts-before":e.index,"--z-index":vt.toasts.length-e.index,"--offset":`${l(d)?l(v):l(R)}px`,"--initial-height":e.expandByDefault?"auto":`${l(m)}px`})},[()=>wt(Vn(e.class,l(O),l(W)?.toast,e.toast?.classes?.toast,l(W)?.[l(C)],e.toast?.classes?.[l(C)])),()=>!!e.toast.promise,()=>!!(e.expanded||e.expandByDefault&&l(c))]),ee("pointermove",ge,Ce),ee("pointerup",ge,_e),ee("pointerdown",ge,we),cn("dragend",ge,xe),y(n,ge),ve()}ye(["pointermove","pointerup","pointerdown","click"]);Am();var _b=ur('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function bb(n){var e=_b();y(n,e)}var yb=ur('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function xb(n){var e=yb();y(n,e)}var wb=ur('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function kb(n){var e=wb();y(n,e)}var Sb=ur('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function Cb(n){var e=Sb();y(n,e)}var Tb=ur('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function Eb(n){var e=Tb();y(n,e)}const Nb=3,fh="24px",gh="16px",Ab=4e3,Mb=356,Pb=14,rl="dark",Ss="light";function Ob(n,e){const t={};return[n,e].forEach((r,i)=>{const o=i===1,s=o?"--mobile-offset":"--offset",a=o?gh:fh;function u(c){["top","right","bottom","left"].forEach(d=>{t[`${s}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{const d=r[c];d===void 0?t[`${s}-${c}`]=a:t[`${s}-${c}`]=typeof d=="number"?`${d}px`:d}):u(a)}),t}var Db=P("<ol></ol>"),Ib=P('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-akr77a"><!></section>');function Fb(n,e){he(e,!0);function t(B){return B!=="system"?B:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?rl:Ss}let r=se(e,"invert",3,!1),i=se(e,"position",3,"bottom-right"),o=se(e,"hotkey",19,()=>["altKey","KeyT"]),s=se(e,"expand",3,!1),a=se(e,"closeButton",3,!1),u=se(e,"offset",3,fh),c=se(e,"mobileOffset",3,gh),d=se(e,"theme",3,"light"),f=se(e,"richColors",3,!1),g=se(e,"duration",3,Ab),p=se(e,"visibleToasts",3,Nb),v=se(e,"toastOptions",19,()=>({})),m=se(e,"dir",7,"auto"),h=se(e,"gap",3,Pb),w=se(e,"pauseWhenPageIsHidden",3,!1),b=se(e,"containerAriaLabel",3,"Notifications"),x=se(e,"closeButtonAriaLabel",3,"Close toast"),S=dh(e,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function k(){if(m()!=="auto")return m();if(typeof window>"u"||typeof document>"u")return"ltr";const B=document.documentElement.getAttribute("dir");return B==="auto"||!B?(Yt(()=>m(window.getComputedStyle(document.documentElement).direction??"ltr")),m()):(Yt(()=>m(B)),B)}const C=z(()=>Array.from(new Set([i(),...vt.toasts.filter(B=>B.position).map(B=>B.position)].filter(Boolean))));let N=Q(!1),O=Q(!1),E=Q(We(t(d()))),D=Q(void 0),L=Q(null),V=Q(!1);const G=z(()=>o().join("+").replace(/Key/g,"").replace(/Digit/g,""));gt(()=>{vt.toasts.length<=1&&A(N,!1)}),gt(()=>{const B=vt.toasts.filter(re=>re.dismiss&&!re.delete);if(B.length>0){const re=vt.toasts.map(le=>B.find(Ae=>Ae.id===le.id)?{...le,delete:!0}:le);vt.toasts=re}}),gt(()=>()=>{l(D)&&l(L)&&(l(L).focus({preventScroll:!0}),A(L,null),A(V,!1))}),_t(()=>(vt.reset(),Zs(document,"keydown",re=>{o().every(ke=>re[ke]||re.code===ke)&&(A(N,!0),l(D)?.focus()),re.code==="Escape"&&(document.activeElement===l(D)||l(D)?.contains(document.activeElement))&&A(N,!1)}))),gt(()=>{if(d()!=="system"&&A(E,d()),typeof window<"u"){d()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A(E,rl):A(E,Ss));const B=window.matchMedia("(prefers-color-scheme: dark)"),re=({matches:le})=>{d()==="system"&&A(E,le?rl:Ss,!0)};"addEventListener"in B?B.addEventListener("change",re):B.addListener(re)}});const U=B=>{e.onblur?.(B),l(V)&&!B.currentTarget.contains(B.relatedTarget)&&(A(V,!1),l(L)&&(l(L).focus({preventScroll:!0}),A(L,null)))},M=B=>{e.onfocus?.(B),!(B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false")&&(l(V)||(A(V,!0),A(L,B.relatedTarget,!0)))},j=B=>{e.onpointerdown?.(B),!(B.target instanceof HTMLElement&&B.target.dataset.dismissible==="false")&&A(O,!0)},Y=B=>{e.onmouseenter?.(B),A(N,!0)},Z=B=>{e.onmouseleave?.(B),l(O)||A(N,!1)},W=B=>{e.onmousemove?.(B),A(N,!0)},H=B=>{e.ondragend?.(B),A(N,!1)},ie=B=>{e.onpointerup?.(B),A(O,!1)};Z_.set(new eb);var I=Ib();X(I,"tabindex",-1);var F=_(I);{var R=B=>{var re=ne(),le=q(re);Ue(le,18,()=>l(C),ke=>ke,(ke,Ae,we,_e)=>{const Ce=z(()=>{const[ge,Ve]=Ae.split("-");return{y:ge,x:Ve}}),xe=z(()=>Ob(u(),c()));var Fe=Db();Kl(Fe,ge=>({tabindex:-1,dir:ge,class:e.class,"data-sonner-toaster":!0,"data-sonner-theme":l(E),"data-y-position":l(Ce).y,"data-x-position":l(Ce).x,style:e.style,onblur:U,onfocus:M,onmouseenter:Y,onmousemove:W,onmouseleave:Z,ondragend:H,onpointerdown:j,onpointerup:ie,...S,[Ii]:{"--front-toast-height":`${vt.heights[0]?.height}px`,"--width":`${Mb}px`,"--gap":`${h()}px`,"--offset-top":l(xe)["--offset-top"],"--offset-right":l(xe)["--offset-right"],"--offset-bottom":l(xe)["--offset-bottom"],"--offset-left":l(xe)["--offset-left"],"--mobile-offset-top":l(xe)["--mobile-offset-top"],"--mobile-offset-right":l(xe)["--mobile-offset-right"],"--mobile-offset-bottom":l(xe)["--mobile-offset-bottom"],"--mobile-offset-left":l(xe)["--mobile-offset-left"]}}),[()=>k()],void 0,void 0,"svelte-akr77a"),Ue(Fe,23,()=>vt.toasts.filter(ge=>!ge.position&&l(we)===0||ge.position===Ae),ge=>ge.id,(ge,Ve,He,tt)=>{{const rt=$e=>{var Je=ne(),ot=q(Je);{var je=Re=>{var st=ne(),Tt=q(st);It(Tt,()=>e.successIcon??Nt),y(Re,st)},Ge=Re=>{bb(Re)};K(ot,Re=>{e.successIcon?Re(je):e.successIcon!==null&&Re(Ge,1)})}y($e,Je)},Ie=$e=>{var Je=ne(),ot=q(Je);{var je=Re=>{var st=ne(),Tt=q(st);It(Tt,()=>e.errorIcon??Nt),y(Re,st)},Ge=Re=>{xb(Re)};K(ot,Re=>{e.errorIcon?Re(je):e.errorIcon!==null&&Re(Ge,1)})}y($e,Je)},ze=$e=>{var Je=ne(),ot=q(Je);{var je=Re=>{var st=ne(),Tt=q(st);It(Tt,()=>e.warningIcon??Nt),y(Re,st)},Ge=Re=>{kb(Re)};K(ot,Re=>{e.warningIcon?Re(je):e.warningIcon!==null&&Re(Ge,1)})}y($e,Je)},fe=$e=>{var Je=ne(),ot=q(Je);{var je=Re=>{var st=ne(),Tt=q(st);It(Tt,()=>e.infoIcon??Nt),y(Re,st)},Ge=Re=>{Cb(Re)};K(ot,Re=>{e.infoIcon?Re(je):e.infoIcon!==null&&Re(Ge,1)})}y($e,Je)},te=$e=>{var Je=ne(),ot=q(Je);{var je=Re=>{var st=ne(),Tt=q(st);It(Tt,()=>e.closeIcon??Nt),y(Re,st)},Ge=Re=>{Eb(Re)};K(ot,Re=>{e.closeIcon?Re(je):e.closeIcon!==null&&Re(Ge,1)})}y($e,Je)};let ae=z(()=>v()?.duration??g()),me=z(()=>v()?.class??""),ce=z(()=>v()?.descriptionClass||""),pe=z(()=>v()?.style??""),Te=z(()=>v().classes||{}),Be=z(()=>v().unstyled??!1),dt=z(()=>v()?.cancelButtonStyle??""),Ze=z(()=>v()?.actionButtonStyle??""),it=z(()=>v()?.closeButtonAriaLabel??x());mb(ge,{get index(){return l(He)},get toast(){return l(Ve)},get defaultRichColors(){return f()},get duration(){return l(ae)},get class(){return l(me)},get descriptionClass(){return l(ce)},get invert(){return r()},get visibleToasts(){return p()},get closeButton(){return a()},get interacting(){return l(O)},get position(){return Ae},get style(){return l(pe)},get classes(){return l(Te)},get unstyled(){return l(Be)},get cancelButtonStyle(){return l(dt)},get actionButtonStyle(){return l(Ze)},get closeButtonAriaLabel(){return l(it)},get expandByDefault(){return s()},get expanded(){return l(N)},get pauseWhenPageIsHidden(){return w()},get loadingIcon(){return e.loadingIcon},successIcon:rt,errorIcon:Ie,warningIcon:ze,infoIcon:fe,closeIcon:te,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Mn(Fe,ge=>A(D,ge),()=>l(D)),J(()=>Fe.dir=Fe.dir),y(ke,Fe)}),y(B,re)};K(F,B=>{vt.toasts.length>0&&B(R)})}J(()=>X(I,"aria-label",`${b()??""} ${l(G)??""}`)),y(n,I),ve()}function Lb(n,e){const t=$c(e.pattern),r=$c(n),i={};for(let o=0;o<t.length;o++){const s=t[o];if(s==="*")return i.rest=r.slice(o).join("/"),{params:i};const a=r[o];if(a===void 0)return null;if(s.startsWith(":")){i[s.slice(1)]=decodeURIComponent(a);continue}if(s!==a)return null}return t.length!==r.length?null:{params:i}}function $c(n){return n.split("/").filter(Boolean)}let pn="/admin";function Rb(n){pn=n.endsWith("/")?n.slice(0,-1):n}class zb{#e=Q(We({path:"/",params:{},query:new URLSearchParams,fullPath:pn+"/"}));get path(){return l(this.#e).path}get params(){return l(this.#e).params}get query(){return l(this.#e).query}get fullPath(){return l(this.#e).fullPath}_sync(e=[]){const{pathname:t,search:r}=window.location,i=Hb(t),o=new URLSearchParams(r);let s={};for(const a of e){const u=Lb(i,a);if(u){s=u.params;break}}A(this.#e,{path:i,params:s,query:o,fullPath:t},!0)}_set(e){A(this.#e,e,!0)}}const br=new zb;let Vi=[];function Bb(n){Vi=n,br._sync(Vi)}function Ub(n,e={}){const t=n.startsWith(pn+"/")||n===pn?n:n.startsWith("/")?pn+n:pn+"/"+n;t!==window.location.pathname+window.location.search&&(e.replace?window.history.replaceState({},"",t):window.history.pushState({},"",t),br._sync(Vi))}const En=Ub;function Ye(n){return n.startsWith(pn)?n:n.startsWith("/")?pn+n:pn+"/"+n}const Hl=new Set;function jb(n){return Hl.add(n),()=>Hl.delete(n)}function Wb(){let n=!1;const e=()=>{n=!0};for(const t of Hl)t(e);return!n}let il=null,ol=null;function Kb(){il||ol||(il=n=>{if(n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;const e=n.target?.closest("a");if(!e||e.target&&e.target!=="_self"||e.hasAttribute("download")||e.hasAttribute("data-external"))return;const t=e.getAttribute("href");if(!t)return;const r=new URL(t,window.location.origin);if(r.origin===window.location.origin&&r.pathname.startsWith(pn)){if(!Wb()){n.preventDefault();return}n.preventDefault(),window.history.pushState({},"",r.pathname+r.search),br._sync(Vi)}},ol=()=>{br._sync(Vi)},window.addEventListener("click",il),window.addEventListener("popstate",ol),br._sync(Vi))}function Hb(n){return n===pn?"/":n.startsWith(pn+"/")?n.slice(pn.length):n}const _n={get params(){return br.params},get url(){return br.fullPath,new URL(window.location.href)}},hh=Symbol("quoin.context");function Vb(n){bi(hh,n)}function Ca(){const n=to(hh);if(!n)throw new Error("quoin: context not initialized. Wrap your component tree in <AdminRoot> (or call setQuoinContext() directly in tests).");return n}function Jb(n,e){if(e.slots[n])return e.slots[n];const t=n.split(".");for(let r=1;r<t.length;r++){const i=[...t];i[r]="*";const o=i.join(".");if(e.slots[o])return e.slots[o]}return null}const ed=new Map;async function vh(n,e){const t=ed.get(n);if(t)return t;const r=e[n];if(!r)throw new Error(`quoin: component path "${n}" referenced in config but missing from importMap. If you just edited admin.config.ts, restart the dev server or rerun build:admin.`);const o=(await r()).default;return ed.set(n,o),o}async function as(n,e={}){const t=`/api${n}`,r=await fetch(t,{...e,credentials:"include",headers:{...e.body&&typeof e.body=="string"?{"Content-Type":"application/json"}:{},...e.headers}});if(!r.ok)try{const o=await r.json();return{ok:!1,error:o.error||"Request failed",details:o.details,status:r.status}}catch{return{ok:!1,error:`Request failed with status ${r.status}`,status:r.status}}return r.status===204?{ok:!0,data:void 0}:{ok:!0,data:await r.json()}}function Wr(n){return as(n)}function xi(n,e){return as(n,{method:"POST",body:e!==void 0?JSON.stringify(e):void 0})}function ph(n,e){return as(n,{method:"PUT",body:JSON.stringify(e)})}function mh(n){return as(n,{method:"DELETE"})}function _h(n,e){return as(n,{method:"POST",body:e})}function td(n,e){return xi("/auth/login",{email:n,password:e})}function qb(){return xi("/auth/logout")}function bh(){return Wr("/auth/me")}function Gb(n,e){return xi("/auth/register",{username:n,password:e})}function Yb(){return Wr("/auth/setup-status")}const Zb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Xb=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const nd=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim();var Qb=ur("<svg><!><!></svg>");function De(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]),r=Pe(t,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);he(e,!1);let i=se(e,"name",8,void 0),o=se(e,"color",8,"currentColor"),s=se(e,"size",8,24),a=se(e,"strokeWidth",8,2),u=se(e,"absoluteStrokeWidth",8,!1),c=se(e,"iconNode",24,()=>[]);ss();var d=Qb();Kl(d,(p,v,m)=>({...Zb,...p,...r,width:s(),height:s(),stroke:o(),"stroke-width":v,class:m}),[()=>Xb(r)?void 0:{"aria-hidden":"true"},()=>(Gr(u()),Gr(a()),Gr(s()),Yt(()=>u()?Number(a())*24/Number(s()):a())),()=>(Gr(nd),Gr(i()),Gr(t),Yt(()=>nd("lucide-icon","lucide",i()?`lucide-${i()}`:"",t.class)))]);var f=_(d);Ue(f,1,c,ut,(p,v)=>{var m=z(()=>cg(l(v),2));let h=()=>l(m)[0],w=()=>l(m)[1];var b=ne(),x=q(b);S_(x,h,!0,(S,k)=>{Kl(S,()=>({...w()}))}),y(p,b)});var g=T(f);Oe(g,e,"default",{}),y(n,d),ve()}function $b(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]];De(n,Me({name:"arrow-down"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ey(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];De(n,Me({name:"arrow-up"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ty(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"}]];De(n,Me({name:"bold"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ny(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 7a2 2 0 0 0-2 2v11"}],["path",{d:"M5.803 18H5a2 2 0 0 0 0 4h9.5a.5.5 0 0 0 .5-.5V21"}],["path",{d:"M9 15V4a2 2 0 0 1 2-2h9.5a.5.5 0 0 1 .5.5v14a.5.5 0 0 1-.5.5H11a2 2 0 0 1 0-4h10"}]];De(n,Me({name:"book-copy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Io(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 7v14"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"}]];De(n,Me({name:"book-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ry(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 14v2.2l1.6 1"}],["path",{d:"M16 2v4"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"}],["path",{d:"M3 10h5"}],["path",{d:"M8 2v4"}],["circle",{cx:"16",cy:"16",r:"6"}]];De(n,Me({name:"calendar-clock"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function rd(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];De(n,Me({name:"chart-column"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function yh(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];De(n,Me({name:"check"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ta(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];De(n,Me({name:"chevron-down"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function iy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 18-6-6 6-6"}]];De(n,Me({name:"chevron-left"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Vu(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];De(n,Me({name:"chevron-right"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function xh(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m18 15-6-6-6 6"}]];De(n,Me({name:"chevron-up"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function oy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]];De(n,Me({name:"code-xml"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function sy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 18 6-6-6-6"}],["path",{d:"m8 6-6 6 6 6"}]];De(n,Me({name:"code"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ay(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];De(n,Me({name:"columns-3"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ly(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];De(n,Me({name:"copy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function uy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];De(n,Me({name:"download"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function cy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];De(n,Me({name:"ellipsis-vertical"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function dy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];De(n,Me({name:"external-link"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function wh(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];De(n,Me({name:"eye"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ju(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];De(n,Me({name:"file-text"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Xs(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];De(n,Me({name:"folder-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function fy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}]];De(n,Me({name:"folder-tree"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function gy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"m17 12 3-2v8"}]];De(n,Me({name:"heading-1"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function hy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"}]];De(n,Me({name:"heading-3"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function vy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 12h8"}],["path",{d:"M4 18V6"}],["path",{d:"M12 18V6"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"}]];De(n,Me({name:"heading-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function py(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]];De(n,Me({name:"history"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Vl(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];De(n,Me({name:"image"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function my(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["line",{x1:"19",x2:"10",y1:"4",y2:"4"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20"}]];De(n,Me({name:"italic"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function _y(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]];De(n,Me({name:"layout-grid"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function by(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M11 5h10"}],["path",{d:"M11 12h10"}],["path",{d:"M11 19h10"}],["path",{d:"M4 4h1v5"}],["path",{d:"M4 9h2"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02"}]];De(n,Me({name:"list-ordered"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function kh(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 5h.01"}],["path",{d:"M3 12h.01"}],["path",{d:"M3 19h.01"}],["path",{d:"M8 5h13"}],["path",{d:"M8 12h13"}],["path",{d:"M8 19h13"}]];De(n,Me({name:"list"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function yy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1"}]];De(n,Me({name:"lock-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function xy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];De(n,Me({name:"lock"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function wy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m16 17 5-5-5-5"}],["path",{d:"M21 12H9"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}]];De(n,Me({name:"log-out"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function ky(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}]];De(n,Me({name:"mail"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Sy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14"}],["path",{d:"M8 6v8"}]];De(n,Me({name:"megaphone"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Cy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];De(n,Me({name:"menu"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ty(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];De(n,Me({name:"message-square"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ey(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 4.1 12 6"}],["path",{d:"m5.1 8-2.9-.8"}],["path",{d:"m6 12-1.9 2"}],["path",{d:"M7.2 2.2 8 5.1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"}]];De(n,Me({name:"mouse-pointer-click"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ny(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]];De(n,Me({name:"panel-left-close"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ay(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m14 9 3 3-3 3"}]];De(n,Me({name:"panel-left-open"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function My(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M13 21h8"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}]];De(n,Me({name:"pen-line"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Py(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];De(n,Me({name:"pencil"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function qu(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];De(n,Me({name:"plus"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Oy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z"}]];De(n,Me({name:"puzzle"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Sh(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"}]];De(n,Me({name:"quote"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Dy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]];De(n,Me({name:"redo-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Iy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];De(n,Me({name:"rotate-ccw"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Gu(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];De(n,Me({name:"search"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Fy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];De(n,Me({name:"settings"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ly(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5"}]];De(n,Me({name:"sticky-note"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ry(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12"}]];De(n,Me({name:"strikethrough"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function zy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];De(n,Me({name:"tag"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function By(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor"}]];De(n,Me({name:"tags"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ch(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];De(n,Me({name:"trash-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Uy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];De(n,Me({name:"triangle-alert"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function jy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18"}],["path",{d:"M4 22h16"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6"}]];De(n,Me({name:"trophy"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Wy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]];De(n,Me({name:"undo-2"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ky(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20"}]];De(n,Me({name:"underline"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Ho(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];De(n,Me({name:"upload"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Hy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["circle",{cx:"9",cy:"7",r:"4"}]];De(n,Me({name:"users"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function or(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];De(n,Me({name:"x"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Vy(n,e){const t=Pe(e,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17"}],["path",{d:"m10 15 5-3-5-3z"}]];De(n,Me({name:"youtube"},()=>t,{get iconNode(){return r},children:(i,o)=>{var s=ne(),a=q(s);Oe(a,e,"default",{}),y(i,s)},$$slots:{default:!0}}))}function Th(n){return Wr(`/globals/${n}`)}function Jy(n,e){return ph(`/globals/${n}`,e)}const xt=We({siteName:"Quoin",logoUrl:null,faviconUrl:null});let id=!1;function qy(){try{const n=Ca();n.config.brand.name&&(xt.siteName=n.config.brand.name),n.config.brand.logo&&(xt.logoUrl=n.config.brand.logo)}catch{}}async function Eh(){if(id)return;id=!0;const n=await Th("site-settings");if(!n.ok)return;const e=n.data??{};typeof e.siteName=="string"&&e.siteName.trim()&&(xt.siteName=e.siteName.trim()),e.logo&&typeof e.logo=="object"&&typeof e.logo.url=="string"?xt.logoUrl=e.logo.url:typeof e.logo=="string"&&e.logo&&(xt.logoUrl=e.logo),e.favicon&&typeof e.favicon=="object"&&typeof e.favicon.url=="string"?xt.faviconUrl=e.favicon.url:typeof e.favicon=="string"&&e.favicon&&(xt.faviconUrl=e.favicon)}var Gy=P('<span class="text-xs text-red-500"> </span>');function Qs(n,e){he(e,!0);let t=dh(e,["$$slots","$$events","$$legacy","name","children"]);const r=Ca(),i=Jb(e.name,r.config);let o=Q(null),s=Q(null);_t(async()=>{if(i)try{A(o,await vh(i,r.importMap),!0)}catch(f){A(s,f instanceof Error?f.message:String(f),!0),console.error(`[quoin:Slot] Failed to load override for "${e.name}":`,f)}});var a=ne(),u=q(a);{var c=f=>{var g=ne(),p=q(g);{var v=h=>{const w=z(()=>l(o));var b=ne(),x=q(b);Qt(x,()=>l(w),(S,k)=>{k(S,Me(()=>t))}),y(h,b)},m=h=>{var w=Gy(),b=_(w);J(()=>{X(w,"title",l(s)),$(b,`slot load error: ${e.name??""}`)}),y(h,w)};K(p,h=>{l(o)?h(v):l(s)&&h(m,1)})}y(f,g)},d=f=>{var g=ne(),p=q(g);It(p,()=>e.children,()=>t),y(f,g)};K(u,f=>{i?f(c):e.children&&f(d,1)})}y(n,a),ve()}var Yy=P('<div class="flex h-screen items-center justify-center bg-background"><div class="flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10"><!></div></div>'),Zy=P('<img class="h-20 w-auto max-w-[280px] object-contain"/>'),Xy=P('<div class="flex h-16 w-16 items-center justify-center rounded-2xl bg-sidebar-accent"><!></div>'),Qy=P('<h1 class="text-3xl font-semibold tracking-tight text-white" style="font-family: var(--font-display);"> </h1>'),$y=P('<p class="mt-3 text-base leading-relaxed text-sidebar-foreground/70" style="font-family: var(--font-display); font-style: italic;"> </p>'),ex=P('<img class="h-14 w-auto max-w-[220px] object-contain"/>'),tx=P('<div class="mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10"><!></div> <h1 class="text-xl font-semibold" style="font-family: var(--font-display);"> </h1>',1),nx=P('<div><label for="confirmPassword" class="mb-2 block text-[13px] font-medium text-foreground">Confirm Password</label> <input id="confirmPassword" type="password" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="Confirm password" autocomplete="new-password"/></div>'),rx=P('<div class="flex min-h-screen"><div class="relative hidden w-1/2 overflow-hidden bg-sidebar-background lg:flex lg:flex-col lg:items-center lg:justify-center"><div class="absolute inset-0 opacity-[0.03]" style="background-image: radial-gradient(circle at 1px 1px, white 1px, transparent 0); background-size: 32px 32px;"></div> <div class="relative z-10 max-w-md px-12 text-center"><div class="mb-8 flex justify-center"><!></div> <!> <!> <div class="mx-auto mt-8 h-px w-16 bg-sidebar-accent/40"></div></div></div> <div class="flex flex-1 items-center justify-center bg-background p-6"><div class="w-full max-w-sm"><div class="mb-8 flex flex-col items-center lg:hidden"><!></div> <div class="mb-8"><h2 class="text-xl font-semibold tracking-tight" style="font-family: var(--font-display);"> </h2> <p class="mt-1.5 text-sm text-muted-foreground"> </p></div> <form class="space-y-5"><div><label for="email" class="mb-2 block text-[13px] font-medium text-foreground">Email</label> <input id="email" type="email" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="you@example.com" autocomplete="email"/></div> <div><label for="password" class="mb-2 block text-[13px] font-medium text-foreground">Password</label> <input id="password" type="password" class="h-11 w-full rounded-lg border border-border bg-card px-3.5 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10" placeholder="Enter password"/></div> <!> <button type="submit" class="h-11 w-full rounded-lg bg-primary text-sm font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.99] disabled:opacity-50 disabled:shadow-none"> </button></form> <div class="mt-6 text-center"><button type="button" class="text-[13px] text-muted-foreground transition-colors hover:text-primary"> </button></div></div></div></div>');function ix(n,e){he(e,!0);let t=Q(""),r=Q(""),i=Q(""),o=Q(!1),s=Q(!1),a=Q(!0);_t(async()=>{if(Eh(),(await bh()).ok){await En(Ye("/"));return}const h=await Yb();h.ok&&h.data.needsSetup&&A(o,!0),A(a,!1)});async function u(){if(!l(t)||!l(r)){Ke.error("Please enter email and password");return}A(s,!0);const m=await td(l(t),l(r));A(s,!1),m.ok?await En(Ye("/")):m.status===401?Ke.error("Invalid credentials"):Ke.error(m.error)}async function c(){if(!l(t)||!l(r)){Ke.error("Please enter email and password");return}if(l(r)!==l(i)){Ke.error("Passwords do not match");return}if(l(r).length<6){Ke.error("Password must be at least 6 characters");return}A(s,!0);const m=await Gb(l(t),l(r));A(s,!1),m.ok?(Ke.success("Admin account created! Logging in..."),(await td(l(t),l(r))).ok?await En(Ye("/")):(Ke.error("Account created but login failed. Please try logging in."),A(o,!1))):Ke.error(m.error)}function d(){A(o,!l(o)),A(i,"")}var f=ne(),g=q(f);{var p=m=>{var h=Yy(),w=_(h),b=_(w);Io(b,{class:"h-5 w-5 text-primary animate-spin-slow"}),y(m,h)},v=m=>{var h=rx(),w=_(h),b=T(_(w),2),x=_(b),S=_(x);Qs(S,{name:"branding.logo",get siteName(){return xt.siteName},get logoUrl(){return xt.logoUrl},children:Ce=>{var xe=ne(),Fe=q(xe);{var ge=He=>{var tt=Zy();J(()=>{X(tt,"src",xt.logoUrl),X(tt,"alt",xt.siteName)}),y(He,tt)},Ve=He=>{var tt=Xy(),rt=_(tt);Io(rt,{class:"h-8 w-8 text-sidebar-accent-foreground"}),y(He,tt)};K(Fe,He=>{xt.logoUrl?He(ge):He(Ve,-1)})}y(Ce,xe)},$$slots:{default:!0}});var k=T(x,2);{var C=_e=>{var Ce=Qy(),xe=_(Ce);J(()=>$(xe,xt.siteName)),y(_e,Ce)};K(k,_e=>{xt.logoUrl||_e(C)})}var N=T(k,2);Qs(N,{name:"login.tagline",children:Ce=>{var xe=$y(),Fe=_(xe);J(()=>$(Fe,`${xt.siteName??""} Admin`)),y(Ce,xe)},$$slots:{default:!0}});var O=T(w,2),E=_(O),D=_(E),L=_(D);{var V=_e=>{var Ce=ex();J(()=>{X(Ce,"src",xt.logoUrl),X(Ce,"alt",xt.siteName)}),y(_e,Ce)},G=_e=>{var Ce=tx(),xe=q(Ce),Fe=_(xe);Io(Fe,{class:"h-6 w-6 text-primary"});var ge=T(xe,2),Ve=_(ge);J(()=>$(Ve,xt.siteName)),y(_e,Ce)};K(L,_e=>{xt.logoUrl?_e(V):_e(G,-1)})}var U=T(D,2),M=_(U),j=_(M),Y=T(M,2),Z=_(Y),W=T(U,2),H=_(W),ie=T(_(H),2),I=T(H,2),F=T(_(I),2),R=T(I,2);{var B=_e=>{var Ce=nx(),xe=T(_(Ce),2);Mt(xe,()=>l(i),Fe=>A(i,Fe)),y(_e,Ce)};K(R,_e=>{l(o)&&_e(B)})}var re=T(R,2),le=_(re),ke=T(W,2),Ae=_(ke),we=_(Ae);J(()=>{$(j,l(o)?"Create your account":"Sign in"),$(Z,l(o)?"Set up the first admin account to get started.":"Enter your credentials to continue."),X(F,"autocomplete",l(o)?"new-password":"current-password"),re.disabled=l(s),$(le,l(s)?"Please wait...":l(o)?"Create Account":"Sign In"),$(we,l(o)?"Already have an account? Sign in":"First time? Create admin account")}),cn("submit",W,_e=>{_e.preventDefault(),l(o)?c():u()}),Mt(ie,()=>l(t),_e=>A(t,_e)),Mt(F,()=>l(r),_e=>A(r,_e)),ee("click",Ae,d),y(m,h)};K(g,m=>{l(a)?m(p):m(v,-1)})}y(n,f),ve()}ye(["click"]);function ox(){return Wr("/_schema")}const hn=We({collections:[],globals:[]});function vo(n,e){return n.find(t=>t.key===e)}var sx=P('<img class="h-9 w-auto max-w-[180px] object-contain"/>'),ax=P('<div class="flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-accent"><!></div> <div class="flex flex-col"><span class="text-sm font-semibold tracking-tight text-white" style="font-family: var(--font-display);"> </span> <span class="text-[10px] uppercase tracking-widest text-sidebar-muted">Admin</span></div>',1),lx=P("<li><a><!> </a></li>"),ux=P('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted"> </p> <ul class="space-y-0.5"></ul></div>'),cx=P("<li><a><!> </a></li>"),dx=P('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted"> </p> <ul class="space-y-0.5"></ul></div>'),fx=P("<li><a><!> </a></li>"),gx=P('<div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted">Settings</p> <ul class="space-y-0.5"></ul></div>'),hx=P('<aside class="flex h-full w-64 flex-col bg-sidebar-background text-sidebar-foreground"><div class="flex h-16 items-center justify-between px-5"><a class="flex min-w-0 items-center gap-2.5"><!></a> <button class="rounded-md p-1.5 text-sidebar-muted transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground" title="Collapse sidebar"><!></button></div> <div class="mx-4 border-t border-sidebar-border"></div> <nav class="flex-1 overflow-y-auto px-3 py-4 scrollbar-hide"><!> <div class="mb-5"><p class="mb-2 px-3 text-[10px] font-semibold uppercase tracking-[0.15em] text-sidebar-muted">Tools</p> <ul class="space-y-0.5"><li><a><!> Ad Analytics</a></li></ul></div> <!> <!></nav> <div class="border-t border-sidebar-border px-4 py-3"><div class="flex items-center justify-between"><div class="flex items-center gap-2.5"><div class="flex h-7 w-7 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-semibold text-sidebar-accent-foreground"> </div> <span class="text-xs text-sidebar-foreground"> </span></div> <button class="rounded-md p-1.5 text-sidebar-muted transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground" title="Logout"><!></button></div></div></aside>'),vx=P('<button class="fixed left-3 top-4 z-50 rounded-lg border border-border bg-card p-2 shadow-md transition-colors hover:bg-secondary" title="Open sidebar"><!></button>');function px(n,e){he(e,!0);const t=Ca(),r=z(()=>{const h={};for(const[w,b]of Object.entries(t.config.pages)){if(!b.nav)continue;const x=b.nav.group??"Tools";h[x]||(h[x]=[]),h[x].push({slug:w,label:b.nav.label,icon:b.nav.icon})}return h}),i={posts:My,authors:Hy,categories:fy,tags:zy,series:ny,competitions:jy,ads:Sy,subscribers:ky,pages:Ly,menus:Cy,media:Vl,media_folders:Xs,media_tags:By,contact_messages:Ty,ad_impressions:rd,ad_clicks:Ey};function o(h){return i[h]||Ju}let s=se(e,"open",15,!0),a=z(()=>{const h={};for(const w of e.collections){const b=w.admin?.group||"Collections";h[b]||(h[b]=[]),h[b].push(w)}for(const w of Object.values(h))w.sort((b,x)=>b.label.localeCompare(x.label));return h}),u=z(()=>Object.keys(l(a)).sort()),c=z(()=>_n.url.pathname);function d(h){return l(c)===h||l(c).startsWith(`${h}/`)}async function f(){(await qb()).ok?await En(Ye("/login")):Ke.error("Logout failed")}var g=ne(),p=q(g);{var v=h=>{var w=hx(),b=_(w),x=_(b),S=_(x);Qs(S,{name:"branding.logo",get siteName(){return xt.siteName},get logoUrl(){return xt.logoUrl},children:le=>{var ke=ne(),Ae=q(ke);{var we=Ce=>{var xe=sx();J(()=>{X(xe,"src",xt.logoUrl),X(xe,"alt",xt.siteName)}),y(Ce,xe)},_e=Ce=>{var xe=ax(),Fe=q(xe),ge=_(Fe);Io(ge,{class:"h-4 w-4 text-sidebar-accent-foreground"});var Ve=T(Fe,2),He=_(Ve),tt=_(He);J(()=>$(tt,xt.siteName)),y(Ce,xe)};K(Ae,Ce=>{xt.logoUrl?Ce(we):Ce(_e,-1)})}y(le,ke)},$$slots:{default:!0}});var k=T(x,2),C=_(k);Ny(C,{class:"h-4 w-4"});var N=T(b,4),O=_(N);Ue(O,17,()=>l(u),ut,(re,le)=>{var ke=ux(),Ae=_(ke),we=_(Ae),_e=T(Ae,2);Ue(_e,21,()=>l(a)[l(le)],ut,(Ce,xe)=>{const Fe=z(()=>o(l(xe).key));var ge=lx(),Ve=_(ge),He=_(Ve);{let rt=z(()=>d(Ye(`/${l(xe).key}`))?"opacity-100":"");Qt(He,()=>l(Fe),(Ie,ze)=>{ze(Ie,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(rt)??""}`}})})}var tt=T(He);J((rt,Ie)=>{X(Ve,"href",rt),Ee(Ve,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
3
|
-
${Ie??""}`),$(tt,` ${(l(xe).labelPlural||l(xe).label)??""}`)},[()=>Ye(`/${l(xe).key}`),()=>d(Ye(`/${l(xe).key}`))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(Ce,ge)}),J(()=>$(we,l(le))),y(re,ke)});var E=T(O,2),D=T(_(E),2),L=_(D),V=_(L),G=_(V);{let re=z(()=>d(Ye("/ads-analytics"))?"opacity-100":"");rd(G,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(re)??""}`}})}var U=T(E,2);Ue(U,17,()=>Object.entries(l(r)),ut,(re,le)=>{var ke=z(()=>cg(l(le),2));let Ae=()=>l(ke)[0],we=()=>l(ke)[1];var _e=dx(),Ce=_(_e),xe=_(Ce),Fe=T(Ce,2);Ue(Fe,21,we,ut,(ge,Ve)=>{const He=z(()=>Ye(`/pages/${l(Ve).slug}`));var tt=cx(),rt=_(tt),Ie=_(rt);{let fe=z(()=>d(l(He))?"opacity-100":"");Oy(Ie,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(fe)??""}`}})}var ze=T(Ie);J(fe=>{X(rt,"href",l(He)),Ee(rt,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
4
|
-
${fe??""}`),$(ze,` ${l(Ve).label??""}`)},[()=>d(l(He))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(ge,tt)}),J(()=>$(xe,Ae())),y(re,_e)});var M=T(U,2);{var j=re=>{var le=gx(),ke=T(_(le),2);Ue(ke,21,()=>e.globals,ut,(Ae,we)=>{var _e=fx(),Ce=_(_e),xe=_(Ce);{let ge=z(()=>d(Ye(`/globals/${l(we).key}`))?"opacity-100":"");Fy(xe,{get class(){return`h-4 w-4 shrink-0 opacity-60 group-hover:opacity-100 ${l(ge)??""}`}})}var Fe=T(xe);J((ge,Ve)=>{X(Ce,"href",ge),Ee(Ce,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
5
|
-
${Ve??""}`),$(Fe,` ${l(we).label??""}`)},[()=>Ye(`/globals/${l(we).key}`),()=>d(Ye(`/globals/${l(we).key}`))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white"]),y(Ae,_e)}),y(re,le)};K(M,re=>{e.globals.length>0&&re(j)})}var Y=T(N,2),Z=_(Y),W=_(Z),H=_(W),ie=_(H),I=T(H,2),F=_(I),R=T(W,2),B=_(R);wy(B,{class:"h-3.5 w-3.5"}),J((re,le,ke,Ae)=>{X(x,"href",re),X(V,"href",le),Ee(V,1,`group flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] transition-all duration-150
|
|
6
|
-
${ke??""}`),$(ie,Ae),$(F,e.user?.username)},[()=>Ye("/"),()=>Ye("/ads-analytics"),()=>d(Ye("/ads-analytics"))?"bg-sidebar-accent text-sidebar-accent-foreground font-medium shadow-sm":"text-sidebar-foreground hover:bg-white/[0.04] hover:text-white",()=>e.user?.username?.charAt(0)?.toUpperCase()||"?"]),ee("click",k,()=>s(!1)),ee("click",R,f),y(h,w)},m=h=>{var w=vx(),b=_(w);Ay(b,{class:"h-4 w-4"}),ee("click",w,()=>s(!0)),y(h,w)};K(p,h=>{s()?h(v):h(m,-1)})}y(n,g),ve()}ye(["click"]);var mx=P('<a class="text-muted-foreground transition-colors hover:text-foreground"> </a>'),_x=P('<span class="font-medium text-foreground"> </span>'),bx=P("<!> <!>",1),yx=P('<a class="inline-flex h-8 items-center gap-1.5 rounded-lg bg-primary px-3.5 text-[13px] font-medium text-primary-foreground shadow-sm transition-all hover:bg-primary/90 hover:shadow-md active:scale-[0.98]"><!> Add New</a>'),xx=P('<header><nav class="flex items-center gap-1.5 text-sm"></nav> <!></header>');function wx(n,e){he(e,!0);let t=se(e,"sidebarOpen",11,!0),r=z(()=>_n.url.pathname),i=z(()=>{const f=l(r).slice(Ye("/").length).split("/").filter(Boolean),g=[];if(f.length===0)return g.push({label:"Dashboard"}),g;if(f[0]==="files")return g.push({label:"Files"}),g;if(f[0]==="globals"&&f[1]){const v=e.globals.find(m=>m.key===f[1]);return g.push({label:"Settings",href:void 0}),g.push({label:v?.label||f[1]}),g}if(f[0]==="login")return g.push({label:"Login"}),g;const p=e.collections.find(v=>v.key===f[0]);return p?(g.push({label:p.labelPlural||p.label,href:Ye(`/${p.key}`)}),f[1]==="new"?g.push({label:"New"}):f[1]&&g.push({label:"Edit"})):g.push({label:f[0]}),g}),o=z(()=>{const f=l(r).slice(Ye("/").length).split("/").filter(Boolean);return f.length===1?e.collections.some(g=>g.key===f[0]):!1}),s=z(()=>{const f=l(r).slice(Ye("/").length).split("/").filter(Boolean);if(f.length>=1){const g=e.collections.find(p=>p.key===f[0]);if(g)return g.key}return null});var a=xx(),u=_(a);Ue(u,21,()=>l(i),ut,(f,g,p)=>{var v=bx(),m=q(v);{var h=S=>{Vu(S,{class:"h-3 w-3 text-muted-foreground/50"})};K(m,S=>{p>0&&S(h)})}var w=T(m,2);{var b=S=>{var k=mx(),C=_(k);J(()=>{X(k,"href",l(g).href),$(C,l(g).label)}),y(S,k)},x=S=>{var k=_x(),C=_(k);J(()=>$(C,l(g).label)),y(S,k)};K(w,S=>{l(g).href&&p<l(i).length-1?S(b):S(x,-1)})}y(f,v)});var c=T(u,2);{var d=f=>{var g=yx(),p=_(g);qu(p,{class:"h-3.5 w-3.5"}),J(v=>X(g,"href",v),[()=>Ye(`/${l(s)}/new`)]),y(f,g)};K(c,f=>{l(o)&&l(s)&&f(d)})}J(()=>Ee(a,1,`flex h-14 items-center justify-between border-b border-border/60 bg-card/80 px-6 backdrop-blur-sm ${t()?"":"pl-14"}`)),y(n,a),ve()}var kx=P('<div class="flex h-screen flex-col items-center justify-center gap-4 bg-background"><div class="flex items-center gap-3"><div class="flex h-10 w-10 items-center justify-center rounded-xl bg-primary/10"><!></div></div> <p class="text-sm text-muted-foreground">Loading admin panel...</p></div>'),Sx=P('<div class="mx-auto max-w-7xl animate-fade-in"><!></div>'),Cx=P('<div class="flex h-screen overflow-hidden bg-background"><!> <div class="flex flex-1 flex-col overflow-hidden"><!> <main><!></main></div></div>');function Tx(n,e){he(e,!0);let t=z(()=>/^\/(admin\/)?[^/]+\/(new|[^/]+)$/.test(_n.url.pathname.replace(/^\/admin/,""))),r=Q(!0),i=Q(null),o=Q(!0);_t(async()=>{const d=await bh();if(!d.ok){await En(Ye("/login"));return}A(i,d.data,!0);const f=await ox();if(!f.ok){await En(Ye("/login"));return}hn.collections=f.data.collections,hn.globals=f.data.globals,Eh(),A(r,!1)});var s=ne(),a=q(s);{var u=d=>{var f=kx(),g=_(f),p=_(g),v=_(p);Io(v,{class:"h-5 w-5 text-primary animate-spin-slow"}),y(d,f)},c=d=>{var f=Cx(),g=_(f);px(g,{get collections(){return hn.collections},get globals(){return hn.globals},get user(){return l(i)},get open(){return l(o)},set open(S){A(o,S,!0)}});var p=T(g,2),v=_(p);{var m=S=>{wx(S,{get collections(){return hn.collections},get globals(){return hn.globals},get sidebarOpen(){return l(o)},set sidebarOpen(k){A(o,k,!0)}})};K(v,S=>{l(t)||S(m)})}var h=T(v,2),w=_(h);{var b=S=>{var k=ne(),C=q(k);It(C,()=>e.children),y(S,k)},x=S=>{var k=Sx(),C=_(k);It(C,()=>e.children),y(S,k)};K(w,S=>{l(t)?S(b):S(x,-1)})}J(()=>Ee(h,1,`flex-1 overflow-y-auto ${l(t)?"":"p-6"}`)),y(d,f)};K(a,d=>{l(r)?d(u):d(c,-1)})}y(n,s),ve()}var Ex=P('<button type="button"> </button>'),Nx=P('<div class="inline-flex items-center gap-1 rounded-lg border border-border/60 bg-card p-1 shadow-sm"></div>');function Ax(n,e){he(e,!0);let t=se(e,"value",15,"7d");const r=["24h","7d","30d"];gt(()=>{if(typeof localStorage>"u")return;const s=localStorage.getItem("dashboard.range");(s==="24h"||s==="7d"||s==="30d")&&t(s)});function i(s){t(s),typeof localStorage<"u"&&localStorage.setItem("dashboard.range",s)}var o=Nx();Ue(o,20,()=>r,s=>s,(s,a)=>{var u=Ex(),c=_(u);J(()=>{Ee(u,1,`rounded-md px-3 py-1 text-sm font-medium transition-colors ${t()===a?"bg-primary text-primary-foreground shadow-sm":"bg-transparent text-foreground hover:bg-secondary"}`),$(c,a)}),ee("click",u,()=>i(a)),y(s,u)}),y(n,o),ve()}ye(["click"]);var Mx=P('<span aria-hidden="true"> </span>'),Px=P('<div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><p class="text-sm font-medium text-muted-foreground"> </p> <p class="mt-2 text-3xl font-semibold tracking-tight text-foreground"> </p> <div class="mt-2"><span><!> <span> </span></span></div></div>');function Cs(n,e){he(e,!0);let t=se(e,"format",3,"int");const r=new Intl.NumberFormat,i=z(()=>e.current===null?"—":t()==="int"?r.format(e.current):t()==="percent"?(e.current*100).toFixed(2)+"%":e.current.toFixed(2)+"pp"),o=z(()=>{if(e.previous===null||e.previous===0||e.current===null)return{text:"—",tone:"none"};if(t()==="pp"){const k=e.current-e.previous;return k===0?{text:"—",tone:"flat"}:{text:(k>0?"+":"")+k.toFixed(2)+"pp",tone:k>0?"up":"down"}}const x=(e.current-e.previous)/e.previous*100;return x===0?{text:"—",tone:"flat"}:{text:(x>0?"+":"")+x.toFixed(1)+"%",tone:x>0?"up":"down"}}),s=z(()=>l(o).tone==="up"?"▲":l(o).tone==="down"?"▼":""),a=z(()=>l(o).tone==="up"?"border-emerald-200 bg-emerald-50 text-emerald-700":l(o).tone==="down"?"border-red-200 bg-red-50 text-red-700":"border-border/60 bg-muted text-muted-foreground");var u=Px(),c=_(u),d=_(c),f=T(c,2),g=_(f),p=T(f,2),v=_(p),m=_(v);{var h=x=>{var S=Mx(),k=_(S);J(()=>$(k,l(s))),y(x,S)};K(m,x=>{l(s)&&x(h)})}var w=T(m,2),b=_(w);J(()=>{$(d,e.label),$(g,l(i)),Ee(v,1,`inline-flex items-center gap-1 rounded-md border px-2 py-0.5 text-xs font-medium ${l(a)??""}`),$(b,l(o).text)}),y(n,u),ve()}var Ox=P('<div class="flex h-72 w-full items-center justify-center rounded-lg border border-dashed border-border/60 bg-muted/20 text-sm text-muted-foreground"> </div>'),Dx=ur('<line stroke="currentColor" stroke-opacity="0.08"></line><text dy="0.32em" text-anchor="end" class="fill-muted-foreground text-[10px]"> </text>',1),Ix=ur('<circle r="3" stroke="white" stroke-width="1.5"></circle><rect fill="transparent"></rect>',1),Fx=ur('<line stroke-opacity="0.35" stroke-dasharray="3 3"></line><circle r="5" stroke="white" stroke-width="2"></circle>',1),Lx=ur('<text text-anchor="middle" class="fill-muted-foreground text-[10px]"> </text>'),Rx=P('<div class="pointer-events-none absolute -translate-x-1/2 -translate-y-full rounded-md bg-foreground px-2.5 py-1.5 text-[11px] leading-tight text-background shadow-lg"><div class="font-semibold"> </div> <div> </div></div>'),zx=P('<div class="flex flex-col gap-3"><div class="flex items-baseline gap-5 px-1 text-[12px] text-muted-foreground"><span><span class="font-medium text-foreground"> </span> total</span> <span>peak <span class="font-medium text-foreground"> </span></span> <span>avg <span class="font-medium text-foreground"> </span></span></div> <div class="relative w-full"><svg class="block h-64 w-full" preserveAspectRatio="none"><!><path fill-opacity="0.15"></path><path fill="none" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path><!><!><!><line stroke="currentColor" stroke-opacity="0.2"></line></svg> <!></div></div>');function $s(n,e){he(e,!0);const t=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}),r=new Intl.DateTimeFormat("en",{weekday:"short",month:"short",day:"numeric"});let i=se(e,"emptyMessage",3,"No data for this range"),o=se(e,"color",3,"#D97706"),s=Q(null);const a=800,u=240,c=36,d=12,f=16,g=28,p=a-c-d,v=u-f-g,m=z(()=>e.data.map(Y=>{const Z=new Date(Y.day);return{...Y,label:t.format(Z),tooltip:r.format(Z)}})),h=z(()=>l(m).reduce((Y,Z)=>Y+Z.count,0)),w=z(()=>l(m).length?Math.max(...l(m).map(Y=>Y.count)):0),b=z(()=>l(m).length?Math.round(l(h)/l(m).length):0),x=z(()=>k(l(w))),S=z(()=>C(l(x),4));function k(Y){if(Y<=0)return 1;const Z=Math.pow(10,Math.floor(Math.log10(Y))),W=Y/Z;return(W<=1?1:W<=2?2:W<=5?5:10)*Z}function C(Y,Z){const W=Y/Z;return Array.from({length:Z+1},(H,ie)=>Math.round(ie*W))}function N(Y){return l(m).length<=1?c+p/2:c+Y/(l(m).length-1)*p}function O(Y){return f+v-Y/l(x)*v}function E(Y){return f+v-Y/l(x)*v}const D=z(()=>l(m).map((Y,Z)=>`${Z===0?"M":"L"} ${N(Z)} ${O(Y.count)}`).join(" ")),L=z(()=>l(m).length===0?"":`${l(D)} L ${N(l(m).length-1)} ${f+v} L ${N(0)} ${f+v} Z`),V=z(()=>Math.max(1,Math.ceil(l(m).length/10)));var G=ne(),U=q(G);{var M=Y=>{var Z=Ox(),W=_(Z);J(()=>$(W,i())),y(Y,Z)},j=Y=>{var Z=zx(),W=_(Z),H=_(W),ie=_(H),I=_(ie),F=T(H,2),R=T(_(F)),B=_(R),re=T(F,2),le=T(_(re)),ke=_(le),Ae=T(W,2),we=_(Ae);X(we,"viewBox","0 0 800 240");var _e=_(we);Ue(_e,17,()=>l(S),ut,(ze,fe)=>{var te=Dx(),ae=q(te);X(ae,"x1",c),X(ae,"x2",a-d);var me=T(ae);X(me,"x",c-6);var ce=_(me);J((pe,Te,Be)=>{X(ae,"y1",pe),X(ae,"y2",Te),X(me,"y",Be),$(ce,l(fe))},[()=>E(l(fe)),()=>E(l(fe)),()=>E(l(fe))]),y(ze,te)});var Ce=T(_e),xe=T(Ce),Fe=T(xe);Ue(Fe,17,()=>l(m),ut,(ze,fe,te)=>{var ae=Ix(),me=q(ae),ce=T(me);X(ce,"y",f),X(ce,"height",v),J((pe,Te,Be,dt)=>{X(me,"cx",pe),X(me,"cy",Te),X(me,"fill",o()),X(ce,"x",Be),X(ce,"width",dt)},[()=>N(te),()=>O(l(fe).count),()=>N(te)-p/Math.max(l(m).length-1,1)/2,()=>p/Math.max(l(m).length-1,1)]),cn("mouseenter",ce,()=>A(s,te,!0)),y(ze,ae)});var ge=T(Fe);{var Ve=ze=>{var fe=Fx(),te=q(fe);X(te,"y1",f),X(te,"y2",f+v);var ae=T(te);J((me,ce,pe,Te)=>{X(te,"x1",me),X(te,"x2",ce),X(te,"stroke",o()),X(ae,"cx",pe),X(ae,"cy",Te),X(ae,"fill",o())},[()=>N(l(s)),()=>N(l(s)),()=>N(l(s)),()=>O(l(m)[l(s)].count)]),y(ze,fe)};K(ge,ze=>{l(s)!==null&&ze(Ve)})}var He=T(ge);Ue(He,17,()=>l(m),ut,(ze,fe,te)=>{var ae=ne(),me=q(ae);{var ce=pe=>{var Te=Lx();X(Te,"y",u-g/3);var Be=_(Te);J(dt=>{X(Te,"x",dt),$(Be,l(fe).label)},[()=>N(te)]),y(pe,Te)};K(me,pe=>{(te%l(V)===0||te===l(m).length-1)&&pe(ce)})}y(ze,ae)});var tt=T(He);X(tt,"x1",c),X(tt,"x2",a-d),X(tt,"y1",f+v),X(tt,"y2",f+v);var rt=T(we,2);{var Ie=ze=>{const fe=z(()=>l(m)[l(s)]);var te=Rx(),ae=_(te),me=_(ae),ce=T(ae,2),pe=_(ce);J((Te,Be,dt)=>{zn(te,`left: ${Te??""}%; top: ${Be??""}%;`),$(me,l(fe).tooltip),$(pe,dt)},[()=>N(l(s))/a*100,()=>O(l(fe).count)/u*100,()=>l(fe).count.toLocaleString()]),y(ze,te)};K(rt,ze=>{l(s)!==null&&ze(Ie)})}J((ze,fe,te)=>{$(I,ze),$(B,fe),$(ke,te),X(Ce,"d",l(L)),X(Ce,"fill",o()),X(xe,"d",l(D)),X(xe,"stroke",o())},[()=>l(h).toLocaleString(),()=>l(w).toLocaleString(),()=>l(b).toLocaleString()]),cn("mouseleave",we,()=>A(s,null)),y(Y,Z)};K(U,Y=>{e.data.length===0?Y(M):Y(j,-1)})}y(n,G),ve()}var Bx=P('<div class="rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700"> </div>'),Ux=P('<div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><p class="text-sm font-medium text-muted-foreground">Total Impressions</p> <p class="mt-2 text-3xl font-semibold tracking-tight text-muted-foreground">—</p> <p class="mt-2 text-xs text-muted-foreground">Admin only</p></div> <div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><p class="text-sm font-medium text-muted-foreground">Total Clicks</p> <p class="mt-2 text-3xl font-semibold tracking-tight text-muted-foreground">—</p> <p class="mt-2 text-xs text-muted-foreground">Admin only</p></div> <div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><p class="text-sm font-medium text-muted-foreground">CTR</p> <p class="mt-2 text-3xl font-semibold tracking-tight text-muted-foreground">—</p> <p class="mt-2 text-xs text-muted-foreground">Admin only</p></div>',1),jx=P("<!> <!> <!>",1),Wx=P('<div class="flex h-72 items-center justify-center text-sm text-muted-foreground">Insufficient access</div>'),Kx=P('<div class="flex h-72 items-center justify-center text-sm text-muted-foreground">Insufficient access</div>'),Hx=P('<p class="px-4 py-8 text-center text-sm text-muted-foreground">Insufficient access</p>'),Vx=P('<p class="px-4 py-8 text-center text-sm text-muted-foreground">No data for this range</p>'),Jx=P('<tr class="border-t border-border/60"><td class="px-3 py-2 truncate max-w-[180px]"> </td><td class="px-3 py-2 text-right tabular-nums"> </td><td class="px-3 py-2 text-right tabular-nums"> </td><td class="px-3 py-2 text-right tabular-nums"> </td></tr>'),qx=P('<table class="w-full text-sm"><thead class="bg-muted/40 text-left text-xs uppercase tracking-wide text-muted-foreground"><tr><th class="cursor-pointer px-3 py-2">Title</th><th class="cursor-pointer px-3 py-2 text-right">Imp</th><th class="cursor-pointer px-3 py-2 text-right">Clk</th><th class="cursor-pointer px-3 py-2 text-right">CTR</th></tr></thead><tbody></tbody></table>'),Gx=P('<p class="px-4 py-8 text-center text-sm text-muted-foreground">No data for this range</p>'),Yx=P('<tr class="border-t border-border/60"><td class="px-3 py-2 truncate max-w-[180px]"><a class="text-primary hover:underline"> </a></td><td class="px-3 py-2 truncate max-w-[120px] text-muted-foreground"> </td><td class="px-3 py-2 text-right tabular-nums"> </td></tr>'),Zx=P('<table class="w-full text-sm"><thead class="bg-muted/40 text-left text-xs uppercase tracking-wide text-muted-foreground"><tr><th class="px-3 py-2">Title</th><th class="px-3 py-2">Slug</th><th class="px-3 py-2 text-right">Imp</th></tr></thead><tbody></tbody></table>'),Xx=P('<p class="px-4 py-8 text-center text-sm text-muted-foreground">No recent posts</p>'),Qx=P('<tr class="border-t border-border/60"><td class="px-3 py-2 truncate max-w-[180px]"><a class="text-primary hover:underline"> </a></td><td class="px-3 py-2"><span> </span></td><td class="px-3 py-2 text-xs text-muted-foreground"> </td></tr>'),$x=P('<table class="w-full text-sm"><thead class="bg-muted/40 text-left text-xs uppercase tracking-wide text-muted-foreground"><tr><th class="px-3 py-2">Title</th><th class="px-3 py-2">Status</th><th class="px-3 py-2">Updated</th></tr></thead><tbody></tbody></table>'),e0=P('<p class="text-center text-xs text-muted-foreground">Loading…</p>'),t0=P('<div class="mx-auto max-w-7xl space-y-6"><header class="flex flex-wrap items-start justify-between gap-4"><div><h1 class="text-2xl font-semibold tracking-tight" style="font-family: var(--font-display);">Welcome back</h1> <p class="mt-1 text-sm text-muted-foreground">Operational overview</p></div> <div class="flex items-center gap-2"><!> <!></div></header> <!> <section class="grid grid-cols-1 gap-4 md:grid-cols-4"><!> <!></section> <section class="grid grid-cols-1 gap-4 md:grid-cols-2"><div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><h3 class="mb-3 text-sm font-semibold">Impressions over time</h3> <!></div> <div class="rounded-lg border border-border/60 bg-card p-4 shadow-sm"><h3 class="mb-3 text-sm font-semibold">Clicks over time</h3> <!></div></section> <section class="grid grid-cols-1 gap-4 lg:grid-cols-3"><div class="rounded-lg border border-border/60 bg-card shadow-sm"><header class="border-b border-border px-4 py-3"><h3 class="text-sm font-semibold">Top Ads</h3> <p class="text-xs text-muted-foreground">by CTR</p></header> <!></div> <div class="rounded-lg border border-border/60 bg-card shadow-sm"><header class="border-b border-border px-4 py-3"><h3 class="text-sm font-semibold">Top Posts</h3> <p class="text-xs text-muted-foreground">by impressions</p></header> <!></div> <div class="rounded-lg border border-border/60 bg-card shadow-sm"><header class="border-b border-border px-4 py-3"><h3 class="text-sm font-semibold">Recent Posts</h3> <p class="text-xs text-muted-foreground">last 10 updated</p></header> <!></div></section> <!></div>');function n0(n,e){he(e,!0);let t=Q("7d"),r=Q(null),i=Q(null),o=Q(null),s=Q(null),a=Q(null),u=Q(!1),c=Q(!1),d=Q(null),f=Q("ctr"),g=Q("desc");async function p(te){try{const ae=await fetch(te,{credentials:"include"});return ae.ok?{ok:!0,data:await ae.json()}:{ok:!1,status:ae.status}}catch{return{ok:!1,status:0}}}async function v(te){A(c,!0),A(d,null);const[ae,me,ce,pe,Te]=await Promise.all([p(`/api/stats/ads/impressions?range=${te}`),p(`/api/stats/ads/clicks?range=${te}`),p(`/api/stats/ads/top?range=${te}&limit=5`),p(`/api/stats/posts/top?range=${te}&limit=5`),p("/api/stats/posts/recent?limit=10")]),Be=ae.ok===!1&&ae.status===403||me.ok===!1&&me.status===403||ce.ok===!1&&ce.status===403;A(u,Be,!0),A(r,ae.ok?ae.data:null,!0),A(i,me.ok?me.data:null,!0),A(s,ce.ok?ce.data.records:null,!0),A(o,pe.ok?pe.data:null,!0),A(a,Te.ok?Te.data.records:null,!0),A(c,!1)}gt(()=>{v(l(t))});const m=z(()=>l(r)&&l(r).current>0&&l(i)?l(i).current/l(r).current:l(r)?0:null),h=z(()=>l(r)&&l(r).previous>0&&l(i)?l(i).previous/l(r).previous:l(r)?0:null),w=z(()=>{if(!l(s))return[];const te=[...l(s)],ae=l(g)==="desc"?-1:1;return te.sort((me,ce)=>{const pe=me[l(f)],Te=ce[l(f)];return typeof pe=="number"&&typeof Te=="number"?(pe-Te)*ae:String(pe??"").localeCompare(String(Te??""))*ae}),te});function b(te){l(f)===te?A(g,l(g)==="desc"?"asc":"desc",!0):(A(f,te,!0),A(g,"desc"))}const x=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});function S(te){const ae=new Date(te).getTime();if(Number.isNaN(ae))return te;const me=ae-Date.now(),ce=Math.abs(me),pe=6e4,Te=36e5,Be=864e5;return ce<Te?x.format(Math.round(me/pe),"minute"):ce<Be?x.format(Math.round(me/Te),"hour"):ce<30*Be?x.format(Math.round(me/Be),"day"):ce<365*Be?x.format(Math.round(me/(30*Be)),"month"):x.format(Math.round(me/(365*Be)),"year")}function k(te){return(te*100).toFixed(2)+"%"}var C=t0(),N=_(C),O=T(_(N),2),E=_(O);Qs(E,{name:"dashboard.actions"});var D=T(E,2);Ax(D,{get value(){return l(t)},set value(te){A(t,te,!0)}});var L=T(N,2);{var V=te=>{var ae=Bx(),me=_(ae);J(()=>$(me,l(d))),y(te,ae)};K(L,te=>{l(d)&&te(V)})}var G=T(L,2),U=_(G);{var M=te=>{var ae=Ux();y(te,ae)},j=te=>{var ae=jx(),me=q(ae);{let Te=z(()=>l(r)?l(r).current:null),Be=z(()=>l(r)?l(r).previous:null);Cs(me,{label:"Total Impressions",get current(){return l(Te)},get previous(){return l(Be)},format:"int"})}var ce=T(me,2);{let Te=z(()=>l(i)?l(i).current:null),Be=z(()=>l(i)?l(i).previous:null);Cs(ce,{label:"Total Clicks",get current(){return l(Te)},get previous(){return l(Be)},format:"int"})}var pe=T(ce,2);Cs(pe,{label:"CTR",get current(){return l(m)},get previous(){return l(h)},format:"percent"}),y(te,ae)};K(U,te=>{l(u)?te(M):te(j,-1)})}var Y=T(U,2);{let te=z(()=>l(o)?l(o).publishedCurrent:null),ae=z(()=>l(o)?l(o).publishedPrevious:null);Cs(Y,{label:"Published Posts",get current(){return l(te)},get previous(){return l(ae)},format:"int"})}var Z=T(G,2),W=_(Z),H=T(_(W),2);{var ie=te=>{var ae=Wx();y(te,ae)},I=te=>{{let ae=z(()=>l(r)?l(r).buckets:[]);$s(te,{get data(){return l(ae)}})}};K(H,te=>{l(u)?te(ie):te(I,-1)})}var F=T(W,2),R=T(_(F),2);{var B=te=>{var ae=Kx();y(te,ae)},re=te=>{{let ae=z(()=>l(i)?l(i).buckets:[]);$s(te,{get data(){return l(ae)}})}};K(R,te=>{l(u)?te(B):te(re,-1)})}var le=T(Z,2),ke=_(le),Ae=T(_(ke),2);{var we=te=>{var ae=Hx();y(te,ae)},_e=te=>{var ae=Vx();y(te,ae)},Ce=te=>{var ae=qx(),me=_(ae),ce=_(me),pe=_(ce),Te=T(pe),Be=T(Te),dt=T(Be),Ze=T(me);Ue(Ze,21,()=>l(w),it=>it.adId,(it,$e)=>{var Je=Jx(),ot=_(Je),je=_(ot),Ge=T(ot),Re=_(Ge),st=T(Ge),Tt=_(st),pt=T(st),et=_(pt);J(nt=>{$(je,l($e).title||"(untitled)"),$(Re,l($e).impressions),$(Tt,l($e).clicks),$(et,nt)},[()=>k(l($e).ctr)]),y(it,Je)}),ee("click",pe,()=>b("title")),ee("click",Te,()=>b("impressions")),ee("click",Be,()=>b("clicks")),ee("click",dt,()=>b("ctr")),y(te,ae)};K(Ae,te=>{l(u)?te(we):!l(s)||l(s).length===0?te(_e,1):te(Ce,-1)})}var xe=T(ke,2),Fe=T(_(xe),2);{var ge=te=>{var ae=Gx();y(te,ae)},Ve=te=>{var ae=Zx(),me=T(_(ae));Ue(me,21,()=>l(o).records,ce=>ce.postId,(ce,pe)=>{var Te=Yx(),Be=_(Te),dt=_(Be),Ze=_(dt),it=T(Be),$e=_(it),Je=T(it),ot=_(Je);J(je=>{X(dt,"href",je),$(Ze,l(pe).title||"(untitled)"),$($e,l(pe).slug),$(ot,l(pe).impressions)},[()=>Ye(`/posts/${l(pe).postId}`)]),y(ce,Te)}),y(te,ae)};K(Fe,te=>{!l(o)||l(o).records.length===0?te(ge):te(Ve,-1)})}var He=T(xe,2),tt=T(_(He),2);{var rt=te=>{var ae=Xx();y(te,ae)},Ie=te=>{var ae=$x(),me=T(_(ae));Ue(me,21,()=>l(a),ce=>ce.id,(ce,pe)=>{var Te=Qx(),Be=_(Te),dt=_(Be),Ze=_(dt),it=T(Be),$e=_(it),Je=_($e),ot=T(it),je=_(ot);J((Ge,Re)=>{X(dt,"href",Ge),$(Ze,l(pe).title||"(untitled)"),Ee($e,1,`inline-flex rounded px-2 py-0.5 text-xs font-medium ${l(pe)._status==="published"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-700"}`),$(Je,l(pe)._status),$(je,Re)},[()=>Ye(`/posts/${l(pe).id}`),()=>S(l(pe).updatedAt)]),y(ce,Te)}),y(te,ae)};K(tt,te=>{!l(a)||l(a).length===0?te(rt):te(Ie,-1)})}var ze=T(le,2);{var fe=te=>{var ae=e0();y(te,ae)};K(ze,te=>{l(c)&&te(fe)})}y(n,C),ve()}ye(["click"]);function Vo(n,e={}){const t=new URLSearchParams;e.page&&t.set("page",String(e.page)),e.perPage&&t.set("perPage",String(e.perPage)),e.sort&&t.set("sort",e.sort),e.filter&&t.set("filter",e.filter),e.search&&t.set("search",e.search),e.expand&&t.set("expand",e.expand),e.fields&&t.set("fields",e.fields);const r=t.toString();return Wr(`/collections/${n}/records${r?`?${r}`:""}`)}function ea(n,e,t,r){const i=new URLSearchParams;t&&i.set("expand",t),r?.draft&&i.set("draft","true");const o=i.toString();return Wr(`/collections/${n}/records/${e}${o?"?"+o:""}`)}function Jl(n,e,t){const r=new URLSearchParams;t?.draft&&r.set("draft","true"),t?.autosave&&r.set("autosave","true");const i=r.toString();return xi(`/collections/${n}/records${i?"?"+i:""}`,e)}function Nh(n,e,t,r){const i=new URLSearchParams;r?.draft&&i.set("draft","true"),r?.autosave&&i.set("autosave","true");const o=i.toString();return ph(`/collections/${n}/records/${e}${o?"?"+o:""}`,t)}function Ah(n,e){return mh(`/collections/${n}/records/${e}`)}function r0(n,e){return xi(`/collections/${n}/records/${e}/unpublish`,{})}function od(n,e){return xi(`/collections/${n}/records/${e}/lock`,{})}function i0(n,e){return mh(`/collections/${n}/records/${e}/lock`)}function ta(n){if(!n)return"";try{return new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return n}}function Yu(n){if(n===0)return"0 B";const e=1024,t=["B","KB","MB","GB"],r=Math.floor(Math.log(n)/Math.log(e));return`${parseFloat((n/e**r).toFixed(1))} ${t[r]}`}function Mh(n,e=50){return!n||n.length<=e?n||"":`${n.slice(0,e)}...`}var o0=P('<span class="text-sm"> </span>');function Ai(n,e){he(e,!0);var t=o0(),r=_(t);J((i,o)=>{X(t,"title",i),$(r,o)},[()=>String(e.value??""),()=>Mh(String(e.value??""),60)]),y(n,t),ve()}function s0(n,e){var t=ne(),r=q(t);{var i=s=>{yh(s,{class:"h-4 w-4 text-green-600"})},o=s=>{or(s,{class:"h-4 w-4 text-muted-foreground"})};K(r,s=>{e.value?s(i):s(o,-1)})}y(n,t)}var a0=P("<span> </span>"),l0=P('<span class="text-sm text-muted-foreground">-</span>');function u0(n,e){he(e,!0);let t=z(()=>e.fieldSchema?.name==="status"&&e.value==="published"&&e.record?.publishedAt&&new Date(e.record.publishedAt)>new Date),r=z(()=>l(t)?"bg-yellow-100 text-yellow-800":e.value==="published"?"bg-green-100 text-green-800":e.value==="draft"?"bg-gray-100 text-gray-800":e.value==="archived"?"bg-red-100 text-red-800":"border");var i=ne(),o=q(i);{var s=u=>{var c=a0(),d=_(c);J(()=>{Ee(c,1,`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l(r)??""}`),$(d,l(t)?"Scheduled":e.value)}),y(u,c)},a=u=>{var c=l0();y(u,c)};K(o,u=>{e.value?u(s):u(a,-1)})}y(n,i),ve()}var c0=P('<span class="text-sm text-muted-foreground"> </span>');function d0(n,e){he(e,!0);var t=c0(),r=_(t);J(i=>$(r,i),[()=>e.value?ta(String(e.value)):"-"]),y(n,t),ve()}var f0=P('<div class="flex items-center gap-1.5"><span class="inline-block h-4 w-4 rounded border"></span> <span class="text-xs text-muted-foreground"> </span></div>'),g0=P('<span class="text-sm text-muted-foreground">-</span>');function h0(n,e){var t=ne(),r=q(t);{var i=s=>{var a=f0(),u=_(a),c=T(u,2),d=_(c);J(()=>{zn(u,`background-color: ${e.value??""}`),$(d,e.value)}),y(s,a)},o=s=>{var a=g0();y(s,a)};K(r,s=>{e.value?s(i):s(o,-1)})}y(n,t)}var v0=P('<span class="text-sm"> </span>');function p0(n,e){he(e,!0);let t=z(()=>e.value?e.fieldSchema?.relationType==="manyToMany"?Array.isArray(e.value)?`${e.value.length} item${e.value.length!==1?"s":""}`:"-":typeof e.value=="object"&&e.value!==null?e.value.name||e.value.title||e.value.label||e.value.slug||e.value.id||"-":String(e.value):"-");var r=v0(),i=_(r);J(()=>$(i,l(t))),y(n,r),ve()}var m0=P('<img alt="" class="h-8 w-8 rounded object-cover"/>'),_0=P('<span class="text-sm text-muted-foreground"> </span>');function sd(n,e){he(e,!0);let t=z(()=>e.value?e.fieldSchema?.multiple?Array.isArray(e.value)?`${e.value.length} file${e.value.length!==1?"s":""}`:"-":typeof e.value=="object"&&e.value!==null&&e.value.filename||"-":"-"),r=z(()=>!e.value||typeof e.value!="object"||e.fieldSchema?.multiple?!1:e.value.mimeType?.startsWith("image/")),i=z(()=>!l(r)||typeof e.value!="object"?"":e.value.url||"");var o=ne(),s=q(o);{var a=c=>{var d=m0();J(()=>X(d,"src",l(i))),y(c,d)},u=c=>{var d=_0(),f=_(d);J(()=>$(f,l(t))),y(c,d)};K(s,c=>{l(r)&&l(i)?c(a):c(u,-1)})}y(n,o),ve()}var b0=P('<span class="text-sm"> </span>');function y0(n,e){he(e,!0);function t(s){if(s==null)return"";if(typeof s=="string")return s;if(Array.isArray(s))return s.map(t).join(" ");if(typeof s=="object"){if(typeof s.text=="string")return s.text;if(Array.isArray(s.content))return s.content.map(t).join(" ")}return""}let r=z(()=>t(e.value).replace(/\s+/g," ").trim());var i=b0(),o=_(i);J(s=>{X(i,"title",l(r)),$(o,s)},[()=>Mh(l(r),60)||"-"]),y(n,i),ve()}const Ts={text:Ai,textarea:Ai,slug:Ai,email:Ai,number:Ai,select:u0,checkbox:s0,date:d0,color:h0,richtext:y0,relationship:p0,upload:sd,file:sd,json:Ai};var x0=P('<th class="px-4 py-3 text-left"><button class="inline-flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"> <!></button></th>'),w0=P('<tr><td class="px-4 py-16 text-center"><div class="flex flex-col items-center gap-2"><div class="h-12 w-12 rounded-xl border-2 border-dashed border-border/80 flex items-center justify-center"><span class="text-lg text-muted-foreground/40">0</span></div> <p class="text-sm text-muted-foreground">No records found</p></div></td></tr>'),k0=P('<span class="font-medium text-foreground"><!></span>'),S0=P('<span class="text-muted-foreground"><!></span>'),C0=P('<td class="px-4 py-3"><!></td>'),T0=P('<tr class="cursor-pointer border-b border-border/40 transition-colors last:border-b-0 hover:bg-secondary/50"><!><td class="px-4 py-3 text-right"><button class="rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive" title="Delete"><!></button></td></tr>'),E0=P('<div class="overflow-x-auto rounded-xl border border-border/60 bg-card shadow-sm"><table class="w-full text-sm"><thead><tr class="border-b border-border/60"><!><th class="w-12 px-4 py-3 text-right text-xs font-semibold uppercase tracking-wider text-muted-foreground"></th></tr></thead><tbody><!></tbody></table></div>');function N0(n,e){he(e,!0);let t=se(e,"sort",3,""),r=se(e,"columnNames",3,null);function i(S){const k=[];for(const C of S){if(C.type==="tabs"){for(const N of C.tabs??[])k.push(...i(N.fields??[]));continue}if(C.type==="row"){k.push(...i(C.fields??[]));continue}k.push(C)}return k}let o=z(()=>i(e.collection.fields)),s=z(()=>r()&&r().length?r().map(S=>l(o).find(k=>k.name===S)).filter(S=>S!==void 0):e.collection.admin?.defaultColumns?.length?e.collection.admin.defaultColumns.map(S=>l(o).find(k=>k.name===S)).filter(S=>S!==void 0):l(o).filter(S=>!S.hidden).slice(0,4)),a=z(()=>e.collection.admin?.useAsTitle||l(s)[0]?.name||"id"),u=z(()=>t().startsWith("-")?t().slice(1):t()),c=z(()=>t().startsWith("-")?"desc":"asc");function d(S){l(u)===S?e.onSort(l(c)==="asc"?`-${S}`:S):e.onSort(S)}var f=E0(),g=_(f),p=_(g),v=_(p),m=_(v);Ue(m,17,()=>l(s),ut,(S,k)=>{var C=x0(),N=_(C),O=_(N),E=T(O);{var D=L=>{var V=ne(),G=q(V);{var U=j=>{ey(j,{class:"h-3 w-3 text-primary"})},M=j=>{$b(j,{class:"h-3 w-3 text-primary"})};K(G,j=>{l(c)==="asc"?j(U):j(M,-1)})}y(L,V)};K(E,L=>{l(u)===l(k).name&&L(D)})}J(()=>$(O,`${l(k).label??""} `)),ee("click",N,()=>d(l(k).name)),y(S,C)});var h=T(p),w=_(h);{var b=S=>{var k=w0(),C=_(k);J(()=>X(C,"colspan",l(s).length+1)),y(S,k)},x=S=>{var k=ne(),C=q(k);Ue(C,19,()=>e.records,N=>N.id,(N,O)=>{var E=T0(),D=_(E);Ue(D,17,()=>l(s),ut,(U,M)=>{var j=C0(),Y=_(j);{var Z=H=>{var ie=k0(),I=_(ie);{var F=B=>{const re=z(()=>Ts[l(M).type]);var le=ne(),ke=q(le);Qt(ke,()=>l(re),(Ae,we)=>{we(Ae,{get value(){return l(O)[l(M).name]},get fieldSchema(){return l(M)},get record(){return l(O)}})}),y(B,le)},R=B=>{var re=ai();J(()=>$(re,l(O)[l(M).name]??"-")),y(B,re)};K(I,B=>{Ts[l(M).type]?B(F):B(R,-1)})}y(H,ie)},W=H=>{var ie=S0(),I=_(ie);{var F=B=>{const re=z(()=>Ts[l(M).type]);var le=ne(),ke=q(le);Qt(ke,()=>l(re),(Ae,we)=>{we(Ae,{get value(){return l(O)[l(M).name]},get fieldSchema(){return l(M)},get record(){return l(O)}})}),y(B,le)},R=B=>{var re=ai();J(()=>$(re,l(O)[l(M).name]??"-")),y(B,re)};K(I,B=>{Ts[l(M).type]?B(F):B(R,-1)})}y(H,ie)};K(Y,H=>{l(M).name===l(a)?H(Z):H(W,-1)})}y(U,j)});var L=T(D),V=_(L),G=_(V);Ch(G,{class:"h-3.5 w-3.5"}),ee("click",E,()=>En(Ye(`/${e.collection.key}/${l(O).id}`))),ee("click",V,U=>{U.stopPropagation(),e.onDelete(l(O).id)}),y(N,E)}),y(S,k)};K(w,S=>{e.records.length===0?S(b):S(x,-1)})}y(n,f),ve()}ye(["click"]);var A0=P('<div class="rounded-lg border border-dashed border-border/60 bg-card py-16 text-center text-sm text-muted-foreground">No records yet</div>'),M0=P('<img class="h-full w-full object-cover transition-transform group-hover:scale-105" loading="lazy"/>'),P0=P('<div class="flex h-full w-full items-center justify-center"><!></div>'),O0=P('<div class="group relative flex flex-col overflow-hidden rounded-lg border border-border/80 bg-card text-left shadow-sm transition-all hover:border-primary/40 hover:shadow-md"><a class="flex flex-col"><div class="relative aspect-square w-full overflow-hidden bg-muted"><!></div> <div class="px-3 py-2"><p class="truncate text-xs font-medium text-foreground"> </p></div></a> <button type="button" class="absolute right-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-md bg-background/90 text-destructive opacity-0 shadow-sm backdrop-blur transition-opacity hover:bg-destructive hover:text-white group-hover:opacity-100" title="Delete"><!></button></div>'),D0=P('<div class="grid gap-3" style="grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));"></div>');function I0(n,e){he(e,!0);function t(v){const m=[];for(const h of v){if(h.type==="tabs"){for(const w of h.tabs??[])m.push(...t(w.fields??[]));continue}if(h.type==="row"){m.push(...t(h.fields??[]));continue}m.push(h)}return m}let r=z(()=>t(e.collection.fields)),i=z(()=>l(r).find(v=>v.type==="file"||v.type==="upload")),o=z(()=>e.collection.admin?.useAsTitle||l(r)[0]?.name||"id");function s(v){if(!v)return null;let m=v;if(typeof m=="string")if(m.startsWith("{"))try{m=JSON.parse(m)}catch{return null}else return{url:m};return typeof m=="object"&&m!==null?m:null}function a(v){if(typeof v.url=="string"&&v.url){const h=typeof v.mimeType=="string"?v.mimeType:"";return h&&!h.startsWith("image/")?null:v.url}if(!l(i))return null;const m=s(v[l(i).name]);return!m?.url||m.mimeType&&!m.mimeType.startsWith("image/")?null:m.url}function u(v){const m=v[l(o)];return m&&typeof m=="string"?m:m&&typeof m=="object"&&"filename"in m?m.filename:v.id||"Untitled"}function c(v,m){v.stopPropagation(),e.onDelete(m)}var d=ne(),f=q(d);{var g=v=>{var m=A0();y(v,m)},p=v=>{var m=D0();Ue(m,21,()=>e.records,h=>h.id,(h,w)=>{const b=z(()=>a(l(w))),x=z(()=>u(l(w)));var S=O0(),k=_(S),C=_(k),N=_(C);{var O=M=>{var j=M0();J(()=>{X(j,"src",l(b)),X(j,"alt",l(x))}),y(M,j)},E=M=>{var j=P0(),Y=_(j);Ju(Y,{class:"h-10 w-10 text-muted-foreground/40"}),y(M,j)};K(N,M=>{l(b)?M(O):M(E,-1)})}var D=T(C,2),L=_(D),V=_(L),G=T(k,2),U=_(G);Ch(U,{class:"h-3.5 w-3.5"}),J(M=>{X(k,"href",M),$(V,l(x))},[()=>Ye(`/${e.collection.key}/${l(w).id}`)]),ee("click",G,M=>c(M,l(w).id)),y(h,S)}),y(v,m)};K(f,v=>{e.records.length===0?v(g):v(p,-1)})}y(n,d),ve()}ye(["click"]);var F0=P('<span class="px-1 text-xs text-muted-foreground/50">...</span>'),L0=P("<button> </button>"),R0=P('<div><p class="text-[13px] text-muted-foreground"><span class="font-medium text-foreground"> </span> </p> <div class="flex items-center gap-1.5"><button class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/60 bg-card text-sm shadow-sm transition-all hover:bg-secondary disabled:opacity-40 disabled:shadow-none"><!></button> <!> <button class="inline-flex h-8 w-8 items-center justify-center rounded-lg border border-border/60 bg-card text-sm shadow-sm transition-all hover:bg-secondary disabled:opacity-40 disabled:shadow-none"><!></button></div></div>');function na(n,e){he(e,!0);let t=se(e,"page",3,1),r=se(e,"totalPages",3,1),i=se(e,"totalRecords",3,0),o=se(e,"perPage",3,20),s=se(e,"class",3,"border-t border-border/60"),a=z(()=>(t()-1)*o()+1),u=z(()=>Math.min(t()*o(),i()));var c=ne(),d=q(c);{var f=g=>{var p=R0(),v=_(p),m=_(v),h=_(m),w=T(m),b=T(v,2),x=_(b),S=_(x);iy(S,{class:"h-4 w-4"});var k=T(x,2);Ue(k,17,()=>Array.from({length:Math.min(r(),7)},(O,E)=>r()<=7?E+1:E===0?1:E===6?r():t()<=3?E===5?-1:E+1:t()>=r()-2?E===1?-1:r()-5+E:E===1||E===5?-1:t()-3+E),ut,(O,E)=>{var D=ne(),L=q(D);{var V=U=>{var M=F0();y(U,M)},G=U=>{var M=L0(),j=_(M);J(()=>{Ee(M,1,`inline-flex h-8 w-8 items-center justify-center rounded-lg text-[13px] transition-all
|
|
7
|
-
${l(E)===t()?"bg-primary font-medium text-primary-foreground shadow-sm":"border border-border/60 bg-card shadow-sm hover:bg-secondary"}`),$(j,l(E))}),ee("click",M,()=>e.onPageChange(l(E))),y(U,M)};K(L,U=>{l(E)===-1?U(V):U(G,-1)})}y(O,D)});var C=T(k,2),N=_(C);Vu(N,{class:"h-4 w-4"}),J(()=>{Ee(p,1,`flex items-center justify-between px-1 py-3 ${s()??""}`),$(h,`${l(a)??""}-${l(u)??""}`),$(w,` of ${i()??""}`),x.disabled=t()<=1,C.disabled=t()>=r()}),ee("click",x,()=>e.onPageChange(t()-1)),ee("click",C,()=>e.onPageChange(t()+1)),y(g,p)};K(d,g=>{r()>1&&g(f)})}y(n,c),ve()}ye(["click"]);var z0=P('<div class="fixed inset-0 z-50 flex items-center justify-center"><div class="fixed inset-0 bg-black/40 backdrop-blur-[2px]"></div> <div class="relative z-10 w-full max-w-md rounded-xl border border-border/60 bg-card p-6 shadow-lg"><div class="flex items-start gap-4"><div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-destructive/10"><!></div> <div><h3 class="font-semibold" style="font-family: var(--font-display);"> </h3> <p class="mt-1.5 text-sm leading-relaxed text-muted-foreground"> </p></div></div> <div class="mt-6 flex justify-end gap-2.5"><button class="h-9 rounded-lg border border-border/60 bg-card px-4 text-sm font-medium shadow-sm transition-all hover:bg-secondary">Cancel</button> <button class="h-9 rounded-lg bg-destructive px-4 text-sm font-medium text-destructive-foreground shadow-sm transition-all hover:bg-destructive/90 disabled:opacity-50"> </button></div></div></div>');function Ph(n,e){he(e,!0);let t=se(e,"open",15,!1),r=se(e,"title",3,"Confirm Delete"),i=se(e,"description",3,"Are you sure? This action cannot be undone."),o=se(e,"isDeleting",3,!1);var s=ne(),a=q(s);{var u=c=>{var d=z0(),f=_(d),g=T(f,2),p=_(g),v=_(p),m=_(v);Uy(m,{class:"h-5 w-5 text-destructive"});var h=T(v,2),w=_(h),b=_(w),x=T(w,2),S=_(x),k=T(p,2),C=_(k),N=T(C,2),O=_(N);J(()=>{$(b,r()),$(S,i()),C.disabled=o(),N.disabled=o(),$(O,o()?"Deleting...":"Delete")}),ee("keydown",d,E=>E.key==="Escape"&&t(!1)),ee("click",f,()=>t(!1)),ee("click",C,()=>t(!1)),ee("click",N,function(...E){e.onConfirm?.apply(this,E)}),y(c,d)};K(a,c=>{t()&&c(u)})}y(n,s),ve()}ye(["keydown","click"]);var B0=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),U0=P('<div class="inline-flex items-center gap-0.5 rounded-lg border border-border/80 bg-card p-0.5 shadow-sm"><button type="button" title="List view"><!></button> <button type="button" title="Grid view"><!></button></div>'),j0=P('<button type="button" class="rounded p-0.5 text-muted-foreground hover:bg-muted disabled:opacity-30" title="Move up"><!></button> <button type="button" class="rounded p-0.5 text-muted-foreground hover:bg-muted disabled:opacity-30" title="Move down"><!></button>',1),W0=P('<div class="flex items-center gap-1 rounded px-1 py-0.5 hover:bg-secondary"><label class="flex flex-1 cursor-pointer items-center gap-2 px-1 py-1 text-sm"><input type="checkbox"/> <span> </span></label> <!></div>'),K0=P('<div class="absolute right-0 z-20 mt-2 w-56 rounded-lg border border-border/80 bg-card p-2 shadow-lg" role="menu"></div>'),H0=P('<a href="/api/subscribers/export.csv" download="" class="inline-flex items-center gap-2 rounded-lg bg-brand-red px-3 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:opacity-90"><!> Export CSV</a>'),V0=P('<div class="flex justify-center py-16"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),J0=P('<div class="space-y-5"><div class="flex items-center justify-between gap-3"><div class="relative w-full max-w-sm"><!> <input type="text" class="h-10 w-full rounded-lg border border-border/80 bg-card pl-10 pr-4 text-sm shadow-sm transition-all placeholder:text-muted-foreground/50 focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10"/></div> <!> <div class="relative"><button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border/80 bg-card px-3 py-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-secondary"><!> Columns</button> <!></div> <!></div> <!> <!> <!></div> <!>',1);function q0(n,e){he(e,!0);let t=z(()=>_n.params.collection??""),r=z(()=>vo(hn.collections,l(t))),i=Q(We([])),o=Q(1),s=Q(1),a=Q(0),u=20,c=Q(""),d=Q(""),f=Q(!1),g=Q(!1),p=Q(""),v=Q(!1),m,h=Q(null),w=Q(null),b=Q(!1),x=Q("list");function S(I){return C(I).some(F=>F.type==="file"||F.type==="upload")}gt(()=>{if(l(r)){if(typeof localStorage<"u"){const I=localStorage.getItem(`view:${l(t)}`);if(I==="grid"||I==="list"){A(x,I,!0);return}}A(x,l(t)==="media"?"grid":"list",!0)}});function k(I){A(x,I,!0),typeof localStorage<"u"&&localStorage.setItem(`view:${l(t)}`,I)}function C(I){const F=[];for(const R of I){if(R.type==="tabs"){for(const B of R.tabs??[])F.push(...C(B.fields??[]));continue}F.push(R)}return F}let N=z(()=>l(r)?C(l(r).fields).filter(I=>!I.hidden):[]);gt(()=>{if(!l(r)||l(w)===l(t))return;const I=typeof localStorage<"u"?localStorage.getItem(`cols:${l(t)}`):null;if(I)try{A(h,JSON.parse(I),!0)}catch{A(h,null)}(!l(h)||!l(h).length)&&A(h,l(r).admin?.defaultColumns?.length?[...l(r).admin.defaultColumns]:C(l(r).fields).filter(F=>!F.hidden).slice(0,4).map(F=>F.name),!0),A(w,l(t),!0)});function O(I){A(h,I,!0),typeof localStorage<"u"&&localStorage.setItem(`cols:${l(t)}`,JSON.stringify(I))}function E(I){const F=l(h)??[];O(F.includes(I)?F.filter(R=>R!==I):[...F,I])}function D(I,F){const R=[...l(h)??[]],B=R.indexOf(I);if(B<0)return;const re=B+F;re<0||re>=R.length||([R[B],R[re]]=[R[re],R[B]],O(R))}let L=z(()=>{const I=(l(h)??[]).map(R=>l(N).find(B=>B.name===R)).filter(Boolean),F=l(N).filter(R=>!(l(h)??[]).includes(R.name));return[...I,...F]});gt(()=>{l(r)&&V()});async function V(){if(!l(r))return;A(f,!0);const I=l(r).admin?.defaultSort||"-createdAt",F=l(r).fields.filter(B=>B.type==="relationship").map(B=>B.name),R=await Vo(l(t),{page:l(o),perPage:u,sort:l(c)||I,search:l(d)||void 0,expand:F.length?F.join(","):void 0});A(f,!1),R.ok?(A(i,R.data.records,!0),A(s,R.data.totalPages,!0),A(a,R.data.totalRecords,!0)):Ke.error(R.error)}function G(I){const F=I.target;A(d,F.value,!0),clearTimeout(m),m=setTimeout(()=>{A(o,1),V()},300)}function U(I){A(c,I,!0),A(o,1),V()}function M(I){A(o,I,!0),V()}function j(I){A(p,I,!0),A(g,!0)}async function Y(){A(v,!0);const I=await Ah(l(t),l(p));A(v,!1),A(g,!1),I.ok?(Ke.success("Record deleted"),await V()):Ke.error(I.error)}var Z=ne(),W=q(Z);{var H=I=>{var F=B0();y(I,F)},ie=I=>{var F=J0(),R=q(F),B=_(R),re=_(B),le=_(re);Gu(le,{class:"absolute left-3.5 top-3 h-4 w-4 text-muted-foreground/60"});var ke=T(le,2),Ae=T(re,2);{var we=ce=>{var pe=U0(),Te=_(pe),Be=_(Te);kh(Be,{class:"h-4 w-4"});var dt=T(Te,2),Ze=_(dt);_y(Ze,{class:"h-4 w-4"}),J(()=>{Ee(Te,1,`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors ${l(x)==="list"?"bg-secondary text-foreground":"text-muted-foreground hover:bg-secondary/60"}`),Ee(dt,1,`inline-flex h-8 w-8 items-center justify-center rounded-md transition-colors ${l(x)==="grid"?"bg-secondary text-foreground":"text-muted-foreground hover:bg-secondary/60"}`)}),ee("click",Te,()=>k("list")),ee("click",dt,()=>k("grid")),y(ce,pe)},_e=z(()=>S(l(r).fields));K(Ae,ce=>{l(_e)&&ce(we)})}var Ce=T(Ae,2),xe=_(Ce),Fe=_(xe);ay(Fe,{class:"h-4 w-4"});var ge=T(xe,2);{var Ve=ce=>{var pe=K0();Ue(pe,23,()=>l(L),Te=>Te.name,(Te,Be)=>{const dt=z(()=>(l(h)??[]).includes(l(Be).name)),Ze=z(()=>(l(h)??[]).indexOf(l(Be).name));var it=W0(),$e=_(it),Je=_($e),ot=T(Je,2),je=_(ot),Ge=T($e,2);{var Re=st=>{var Tt=j0(),pt=q(Tt),et=_(pt);xh(et,{class:"h-3.5 w-3.5"});var nt=T(pt,2),Wt=_(nt);Ta(Wt,{class:"h-3.5 w-3.5"}),J(()=>{pt.disabled=l(Ze)<=0,nt.disabled=l(Ze)>=(l(h)??[]).length-1}),ee("click",pt,()=>D(l(Be).name,-1)),ee("click",nt,()=>D(l(Be).name,1)),y(st,Tt)};K(Ge,st=>{l(dt)&&st(Re)})}J(()=>{O_(Je,l(dt)),$(je,l(Be).label??l(Be).name)}),ee("change",Je,()=>E(l(Be).name)),y(Te,it)}),cn("mouseleave",pe,()=>A(b,!1)),y(ce,pe)};K(ge,ce=>{l(b)&&ce(Ve)})}var He=T(Ce,2);{var tt=ce=>{var pe=H0(),Te=_(pe);uy(Te,{class:"h-4 w-4"}),y(ce,pe)};K(He,ce=>{l(t)==="subscribers"&&ce(tt)})}var rt=T(B,2);na(rt,{get page(){return l(o)},get totalPages(){return l(s)},get totalRecords(){return l(a)},perPage:u,onPageChange:M,class:"border-b border-border/60"});var Ie=T(rt,2);{var ze=ce=>{var pe=V0();y(ce,pe)},fe=ce=>{I0(ce,{get collection(){return l(r)},get records(){return l(i)},onDelete:j})},te=ce=>{N0(ce,{get collection(){return l(r)},get records(){return l(i)},get sort(){return l(c)},get columnNames(){return l(h)},onSort:U,onDelete:j})};K(Ie,ce=>{l(f)?ce(ze):l(x)==="grid"?ce(fe,1):ce(te,-1)})}var ae=T(Ie,2);na(ae,{get page(){return l(o)},get totalPages(){return l(s)},get totalRecords(){return l(a)},perPage:u,onPageChange:M});var me=T(R,2);Ph(me,{title:"Delete Record",description:"Are you sure you want to delete this record? This action cannot be undone.",get isDeleting(){return l(v)},onConfirm:Y,get open(){return l(g)},set open(ce){A(g,ce,!0)}}),J(()=>{ir(ke,l(d)),X(ke,"placeholder",`Search ${(l(r).labelPlural||l(r).label)??""}...`)}),ee("input",ke,G),ee("click",xe,()=>A(b,!l(b))),y(I,F)};K(W,I=>{l(r)?I(ie,-1):I(H)})}y(n,Z),ve()}ye(["input","click","change"]);var G0=P('<span class="inline-flex items-center gap-1.5 text-[11px] text-amber-700"><span class="h-1.5 w-1.5 rounded-full bg-amber-600"></span> Unsaved</span>'),Y0=P('<span class="text-primary">●</span>'),Z0=P('<span class="text-primary">●</span>'),X0=P('<button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Schedule Publish</button>'),Q0=P('<span class="text-primary">●</span>'),$0=P('<div class="absolute right-0 z-20 mt-1 w-44 overflow-hidden rounded-lg border border-border bg-card shadow-lg"><button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Save as draft <!></button> <button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Publish <!></button> <!> <button type="button" class="flex w-full items-center justify-between px-3 py-2 text-left text-xs text-foreground hover:bg-secondary">Archive <!></button></div>'),e1=P('<div class="inline-flex items-center gap-2"><!> <div class="relative"><div class="inline-flex items-stretch overflow-hidden rounded-lg shadow-sm"><button type="button" class="bg-primary px-4 py-2 text-xs font-semibold tracking-wide text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-60"> </button> <button type="button" class="flex items-center border-l border-primary-foreground/15 bg-primary/90 px-2 text-primary-foreground hover:bg-primary disabled:opacity-60" aria-label="Publish options"><!></button></div> <!></div></div>');function t1(n,e){he(e,!0);let t=se(e,"isSubmitting",3,!1),r=se(e,"isDirty",3,!1),i=se(e,"disabled",3,!1),o=se(e,"hasSchedulePublish",3,!1),s=Q(!1),a=Q(null);function u(){A(s,!l(s))}function c(C){A(s,!1),e.onSaveAs(C)}function d(C){l(s)&&l(a)&&!l(a).contains(C.target)&&A(s,!1)}var f=e1();cn("click",jo,d);var g=_(f);{var p=C=>{var N=G0();y(C,N)};K(g,C=>{r()&&C(p)})}var v=T(g,2),m=_(v),h=_(m),w=_(h),b=T(h,2),x=_(b);Ta(x,{class:"h-3.5 w-3.5"});var S=T(m,2);{var k=C=>{var N=$0(),O=_(N),E=T(_(O));{var D=W=>{var H=Y0();y(W,H)};K(E,W=>{e.currentStatus==="draft"&&W(D)})}var L=T(O,2),V=T(_(L));{var G=W=>{var H=Z0();y(W,H)};K(V,W=>{e.currentStatus==="published"&&W(G)})}var U=T(L,2);{var M=W=>{var H=X0();ee("click",H,()=>{A(s,!1),e.onSchedule?.()}),y(W,H)};K(U,W=>{o()&&e.onSchedule&&W(M)})}var j=T(U,2),Y=T(_(j));{var Z=W=>{var H=Q0();y(W,H)};K(Y,W=>{e.currentStatus==="archived"&&W(Z)})}ee("click",O,()=>c("draft")),ee("click",L,()=>c("published")),ee("click",j,()=>c("archived")),y(C,N)};K(S,C=>{l(s)&&C(k)})}Mn(v,C=>A(a,C),()=>l(a)),J(()=>{h.disabled=i()||t(),$(w,t()?"Saving…":e.label),b.disabled=i()||t(),X(b,"aria-expanded",l(s))}),ee("click",h,function(...C){e.onSave?.apply(this,C)}),ee("click",b,u),y(n,f),ve()}ye(["click"]);var n1=P('<span class="flex items-center gap-2"><span class="text-[11px] uppercase tracking-wider text-stone-400">Status:</span> <span><span class="h-1.5 w-1.5 rounded-full bg-current opacity-70"></span> </span></span>'),r1=P('<span><span class="text-stone-400">Last Modified:</span> <span class="ml-1.5 font-medium text-stone-700"> </span></span>'),i1=P('<span><span class="text-stone-400">Created:</span> <span class="ml-1.5 font-medium text-stone-700"> </span></span>'),o1=P("<!> <!>",1),s1=P('<button type="button" class="rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-foreground transition-colors">Unpublish</button>'),a1=P('<div class="flex flex-wrap items-center justify-between gap-4 px-7 pb-4 pt-3.5"><div class="flex flex-wrap items-center gap-5 text-xs text-muted-foreground"><!> <!> <!></div> <div class="flex items-center gap-2"><!> <button type="button" disabled="" class="flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-card text-stone-500 opacity-50 shadow-sm" title="Open in new tab (coming soon)"><!></button> <!> <button type="button" disabled="" class="flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-card text-stone-500 opacity-50 shadow-sm" title="More actions (coming soon)"><!></button></div></div>');function l1(n,e){he(e,!0);let t=se(e,"hasDrafts",3,!1),r=se(e,"hasSchedulePublish",3,!1);const i={draft:"bg-amber-100 text-amber-800 border border-amber-200",published:"bg-emerald-100 text-emerald-800 border border-emerald-200",archived:"bg-stone-200 text-stone-700 border border-stone-300",scheduled:"bg-yellow-100 text-yellow-800 border border-yellow-200"};let o=z(()=>i[e.status?.toLowerCase()]??"bg-stone-100 text-stone-700 border border-stone-200"),s=z(()=>e.status?e.status.charAt(0).toUpperCase()+e.status.slice(1):"—");var a=a1(),u=_(a),c=_(u);{var d=N=>{var O=n1(),E=T(_(O),2),D=T(_(E));J(()=>{Ee(E,1,`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[11px] font-semibold ${l(o)??""}`),$(D,` ${l(s)??""}`)}),y(N,O)};K(c,N=>{t()&&N(d)})}var f=T(c,2);{var g=N=>{var O=o1(),E=q(O);{var D=G=>{var U=r1(),M=T(_(U),2),j=_(M);J(Y=>$(j,Y),[()=>ta(e.record.updatedAt)]),y(G,U)};K(E,G=>{e.record.updatedAt&&G(D)})}var L=T(E,2);{var V=G=>{var U=i1(),M=T(_(U),2),j=_(M);J(Y=>$(j,Y),[()=>ta(e.record.createdAt)]),y(G,U)};K(L,G=>{e.record.createdAt&&G(V)})}y(N,O)};K(f,N=>{e.mode==="edit"&&e.record&&N(g)})}var p=T(f,2);{var v=N=>{var O=ne(),E=q(O);It(E,()=>e.metaExtra),y(N,O)};K(p,N=>{e.metaExtra&&N(v)})}var m=T(u,2),h=_(m);{var w=N=>{var O=s1();ee("click",O,function(...E){e.onUnpublish?.apply(this,E)}),y(N,O)};K(h,N=>{t()&&e.status==="published"&&e.mode!=="create"&&e.onUnpublish&&N(w)})}var b=T(h,2),x=_(b);dy(x,{class:"h-4 w-4"});var S=T(b,2);t1(S,{get label(){return e.saveLabel},get currentStatus(){return e.status},get isSubmitting(){return e.isSubmitting},get isDirty(){return e.isDirty},get hasSchedulePublish(){return r()},get onSave(){return e.onSave},get onSaveAs(){return e.onSaveAs},get onSchedule(){return e.onSchedule}});var k=T(S,2),C=_(k);cy(C,{class:"h-4 w-4"}),y(n,a),ve()}ye(["click"]);var u1=P('<button type="button"> </button>'),c1=P('<div class="flex gap-0.5 border-b border-border px-7"></div>');function d1(n,e){he(e,!0);let t=se(e,"activeIndex",15,0);var r=ne(),i=q(r);{var o=s=>{var a=c1();Ue(a,21,()=>e.tabs,ut,(u,c,d)=>{var f=u1(),g=_(f);J(()=>{Ee(f,1,`-mb-px border-b-2 px-4 py-3 text-[13px] font-medium transition-colors
|
|
8
|
-
${t()===d?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`),$(g,l(c).label)}),ee("click",f,()=>t(d)),y(u,f)}),y(s,a)};K(i,s=>{e.tabs.length>0&&s(o)})}y(n,r),ve()}ye(["click"]);var f1=P('<div class="inline-flex items-stretch overflow-hidden rounded-lg border border-border bg-card shadow-sm"><button type="button">Edit</button> <button type="button">API</button></div>');function g1(n,e){he(e,!0);var t=f1(),r=_(t),i=T(r,2);J(()=>{Ee(r,1,`px-3 py-1.5 text-xs font-medium transition-colors
|
|
9
|
-
${e.mode==="edit"?"bg-primary text-primary-foreground":"text-stone-600 hover:bg-secondary"}`),Ee(i,1,`border-l border-border px-3 py-1.5 text-xs font-medium transition-colors
|
|
10
|
-
${e.mode==="api"?"bg-primary text-primary-foreground":"text-stone-600 hover:bg-secondary"}`)}),ee("click",r,()=>e.setMode("edit")),ee("click",i,()=>e.setMode("api")),y(n,t),ve()}ye(["click"]);var h1=P('<a class="inline-flex items-center gap-1.5 rounded-lg border border-border/80 px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors">Versions</a>'),v1=P('<header class="sticky top-0 z-10 border-b border-border bg-background"><div class="flex items-center justify-between border-b border-stone-200/60 px-7 py-3.5"><div class="flex min-w-0 items-center gap-2.5 text-[13px] text-muted-foreground"><a class="font-medium hover:text-foreground"> </a> <span class="text-stone-300">/</span> <span class="truncate font-medium text-foreground"> </span></div> <!> <!></div> <div class="px-7 pb-2 pt-5"><h1 class="font-display text-[28px] font-semibold leading-tight tracking-tight text-foreground"> </h1></div> <!> <!></header>');function p1(n,e){he(e,!0);let t=se(e,"activeTab",15,0),r=se(e,"hasDrafts",3,!1),i=se(e,"hasSchedulePublish",3,!1);var o=v1(),s=_(o),a=_(s),u=_(a),c=_(u),d=T(u,4),f=_(d),g=T(a,2);{var p=k=>{var C=h1();J(N=>X(C,"href",N),[()=>Ye(`/${e.collection.key}/${e.record.id}/versions`)]),y(k,C)};K(g,k=>{e.collection.versions&&e.record?.id&&k(p)})}var v=T(g,2);g1(v,{get mode(){return e.headerMode},get setMode(){return e.setHeaderMode}});var m=T(s,2),h=_(m),w=_(h),b=T(m,2);l1(b,{get record(){return e.record},get mode(){return e.mode},get status(){return e.status},get saveLabel(){return e.saveLabel},get isDirty(){return e.isDirty},get isSubmitting(){return e.isSubmitting},get hasDrafts(){return r()},get hasSchedulePublish(){return i()},get onSave(){return e.onSave},get onSaveAs(){return e.onSaveAs},get onUnpublish(){return e.onUnpublish},get onSchedule(){return e.onSchedule},get metaExtra(){return e.metaExtra}});var x=T(b,2);{var S=k=>{d1(k,{get tabs(){return e.tabs},get activeIndex(){return t()},set activeIndex(C){t(C)}})};K(x,k=>{e.headerMode==="edit"&&k(S)})}J(k=>{X(u,"href",k),$(c,e.collection.labelPlural||e.collection.label),$(f,e.liveTitle),$(w,e.liveTitle)},[()=>Ye(`/${e.collection.key}`)]),y(n,o),ve()}var m1=P('<span class="text-[11px] text-muted-foreground"> </span>');function _1(n,e){he(e,!0);let t=se(e,"interval",3,2e3),r=Q(null),i=Q(!1),o=!1;function s(h){const{updatedAt:w,createdAt:b,_versionId:x,_versionCreatedAt:S,...k}=h;return JSON.stringify(k)}let a=s(e.formData),u,c=null;async function d(){for(;c;){const h=c;c=null,await h()}}function f(h){c=h,l(i)||d()}gt(()=>{const h=s(e.formData);if(!o){o=!0;return}h!==a&&e.recordId&&(u&&clearTimeout(u),u=setTimeout(()=>{const w=s(e.formData);w!==a&&(a=w,f(async()=>{A(i,!0);const b=await Nh(e.collectionKey,e.recordId,e.formData,{draft:!0,autosave:!0});A(i,!1),b.ok&&A(r,new Date,!0)}))},t()))});let g=z(()=>{if(!l(r))return"";const h=Math.floor((Date.now()-l(r).getTime())/1e3);return h<5?"just now":h<60?`${h}s ago`:`${Math.floor(h/60)}m ago`});var p=ne(),v=q(p);{var m=h=>{var w=m1(),b=_(w);J(()=>$(b,l(i)?"Saving...":`Autosaved ${l(g)}`)),y(h,w)};K(v,h=>{l(r)&&h(m)})}y(n,p),ve()}const b1={"&":"&","<":"<",">":">",'"':""","'":"'"};function y1(n){return n.replace(/[&<>"']/g,e=>b1[e])}function ad(n){const e=/("(?:\\.|[^"\\])*"\s*:?)|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g;return y1(n).replace(e,r=>r.startsWith('"')?r.trimEnd().endsWith(":")?`<span class="text-amber-700">${r}</span>`:`<span class="text-emerald-700">${r}</span>`:r==="true"||r==="false"?`<span class="text-blue-700">${r}</span>`:r==="null"?`<span class="text-stone-500">${r}</span>`:`<span class="text-violet-700">${r}</span>`)}var x1=P('<button type="button" class="inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm hover:bg-secondary"><!> Edit JSON</button>'),w1=P("<!> Copied",1),k1=P("<!> Copy",1),S1=P('<p class="text-xs text-destructive"> </p>'),C1=P('<textarea spellcheck="false" class="block min-h-[420px] w-full rounded-lg border border-border bg-card px-4 py-3 font-mono text-[12px] leading-relaxed text-foreground shadow-sm focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/10"></textarea> <!> <div class="flex items-center gap-2"><button type="button" class="rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground shadow-sm hover:bg-primary/90 disabled:opacity-50">Apply changes</button> <button type="button" class="rounded-lg border border-border bg-card px-4 py-2 text-xs text-foreground hover:bg-secondary">Cancel</button></div>',1),T1=P('<pre class="overflow-auto rounded-lg border border-border bg-card p-4 font-mono text-[12px] leading-relaxed text-foreground shadow-sm"></pre>'),E1=P('<pre class="overflow-auto rounded-lg border border-border bg-card p-4 font-mono text-[12px] leading-relaxed text-foreground shadow-sm"></pre>'),N1=P('<div class="space-y-4 px-7 py-6"><div class="flex items-center justify-between"><div class="flex gap-1"><button type="button">JSON</button> <button type="button">cURL</button></div> <div class="flex items-center gap-2"><!> <button type="button" class="inline-flex items-center gap-1.5 rounded-md border border-border bg-card px-2.5 py-1.5 text-xs text-foreground shadow-sm hover:bg-secondary"><!></button></div></div> <!></div>');function A1(n,e){he(e,!0);let t=se(e,"formData",31,()=>We({})),r=se(e,"recordId",3,null),i=Q("json"),o=Q(!1),s=Q(""),a=Q(null),u=null,c=Q(!1),d=z(()=>JSON.stringify(t(),null,2)),f=z(()=>ad(l(d))),g=z(()=>{const Z=typeof window<"u"?window.location.origin:"http://localhost:5173",W=e.mode==="create"?`${Z}/api/${e.collectionKey}`:`${Z}/api/${e.collectionKey}/${r()}`,H=e.mode==="create"?"POST":"PUT",ie=JSON.stringify(t()).replace(/'/g,"'\\''");return`curl -X ${H} '${W}' \\
|
|
11
|
-
-H 'Content-Type: application/json' \\
|
|
12
|
-
-H 'Cookie: <session>' \\
|
|
13
|
-
-d '${ie}'`}),p=z(()=>ad(l(g)));function v(){A(s,l(d),!0),A(a,null),u=null,A(o,!0)}function m(){A(a,null),u=null;try{const Z=JSON.parse(l(s));if(typeof Z!="object"||Z===null||Array.isArray(Z)){A(a,"Top-level value must be a JSON object");return}u=Z}catch(Z){A(a,Z.message,!0)}}function h(){if(u){for(const Z of Object.keys(t()))delete t()[Z];for(const Z of Object.keys(u))t(t()[Z]=u[Z],!0);A(o,!1),e.onApply(),Ke.success("JSON applied")}}function w(){A(o,!1),A(s,""),A(a,null),u=null}async function b(){const Z=l(i)==="json"?l(d):l(g);try{await navigator.clipboard.writeText(Z),A(c,!0),setTimeout(()=>A(c,!1),1500)}catch{Ke.error("Copy failed")}}var x=N1(),S=_(x),k=_(S),C=_(k),N=T(C,2),O=T(k,2),E=_(O);{var D=Z=>{var W=x1(),H=_(W);Py(H,{class:"h-3.5 w-3.5"}),ee("click",W,v),y(Z,W)};K(E,Z=>{l(i)==="json"&&!l(o)&&Z(D)})}var L=T(E,2),V=_(L);{var G=Z=>{var W=w1(),H=q(W);yh(H,{class:"h-3.5 w-3.5 text-emerald-700"}),y(Z,W)},U=Z=>{var W=k1(),H=q(W);ly(H,{class:"h-3.5 w-3.5"}),y(Z,W)};K(V,Z=>{l(c)?Z(G):Z(U,-1)})}var M=T(S,2);{var j=Z=>{var W=ne(),H=q(W);{var ie=F=>{var R=C1(),B=q(R),re=T(B,2);{var le=_e=>{var Ce=S1(),xe=_(Ce);J(()=>$(xe,`Invalid JSON: ${l(a)??""}`)),y(_e,Ce)};K(re,_e=>{l(a)&&_e(le)})}var ke=T(re,2),Ae=_(ke),we=T(Ae,2);J(()=>Ae.disabled=!u),ee("input",B,m),Mt(B,()=>l(s),_e=>A(s,_e)),ee("click",Ae,h),ee("click",we,w),y(F,R)},I=F=>{var R=T1();Wl(R,()=>l(f),!0),y(F,R)};K(H,F=>{l(o)?F(ie):F(I,-1)})}y(Z,W)},Y=Z=>{var W=E1();Wl(W,()=>l(p),!0),y(Z,W)};K(M,Z=>{l(i)==="json"?Z(j):Z(Y,-1)})}J(()=>{Ee(C,1,`rounded-md px-3 py-1.5 text-xs font-medium transition-colors
|
|
14
|
-
${l(i)==="json"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`),Ee(N,1,`rounded-md px-3 py-1.5 text-xs font-medium transition-colors
|
|
15
|
-
${l(i)==="curl"?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`)}),ee("click",C,()=>A(i,"json")),ee("click",N,()=>A(i,"curl")),ee("click",L,b),y(n,x),ve()}ye(["click","input"]);var M1=P('<a class="inline-flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground"><!> View version history</a>');function P1(n,e){he(e,!0);var t=M1(),r=_(t);py(r,{class:"h-3.5 w-3.5"}),J(i=>X(t,"href",i),[()=>Ye(`/${e.collectionKey}/${e.recordId}/versions`)]),y(n,t),ve()}var O1=P('<p class="text-xs text-destructive"> </p>'),D1=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm" role="presentation"><div class="w-full max-w-md rounded-lg border border-border bg-card shadow-xl" role="dialog" aria-modal="true"><div class="flex items-center gap-3 border-b border-border/60 px-5 py-4"><div class="flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 text-primary"><!></div> <div><h2 class="text-sm font-semibold text-foreground">Schedule Publish</h2> <p class="text-xs text-muted-foreground">Post will publish automatically at the selected time.</p></div></div> <div class="px-5 py-5 space-y-2"><label class="block text-xs font-medium text-foreground" for="schedule-datetime">Publish at</label> <input id="schedule-datetime" type="datetime-local" class="w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary"/> <!></div> <div class="flex justify-end gap-2 border-t border-border/60 px-5 py-3"><button type="button" class="rounded-lg px-3 py-1.5 text-xs font-medium text-muted-foreground hover:bg-secondary hover:text-foreground disabled:opacity-50">Cancel</button> <button type="button" class="rounded-lg bg-primary px-4 py-1.5 text-xs font-semibold text-primary-foreground hover:bg-primary/90 disabled:opacity-60"> </button></div></div></div>');function I1(n,e){he(e,!0);let t=se(e,"open",15,!1),r=se(e,"initialValue",3,""),i=se(e,"isSubmitting",3,!1);function o(){const p=new Date(Date.now()+36e5),v=m=>String(m).padStart(2,"0");return`${p.getFullYear()}-${v(p.getMonth()+1)}-${v(p.getDate())}T${v(p.getHours())}:${v(p.getMinutes())}`}let s=Q(We(r()||o())),a=Q("");gt(()=>{t()&&!l(s)&&A(s,o(),!0)});function u(){if(A(a,""),!l(s)){A(a,"Pick a date and time");return}const p=new Date(l(s));if(isNaN(p.getTime())){A(a,"Invalid date");return}if(p.getTime()<=Date.now()){A(a,"Time must be in the future");return}e.onSchedule(p.toISOString())}function c(){t(!1),A(a,"")}var d=ne(),f=q(d);{var g=p=>{var v=D1(),m=_(v),h=_(m),w=_(h),b=_(w);ry(b,{class:"h-5 w-5"});var x=T(h,2),S=T(_(x),2),k=T(S,2);{var C=L=>{var V=O1(),G=_(V);J(()=>$(G,l(a))),y(L,V)};K(k,L=>{l(a)&&L(C)})}var N=T(x,2),O=_(N),E=T(O,2),D=_(E);J(()=>{O.disabled=i(),E.disabled=i(),$(D,i()?"Scheduling…":"Schedule")}),ee("click",v,c),ee("click",m,L=>L.stopPropagation()),Mt(S,()=>l(s),L=>A(s,L)),ee("click",O,c),ee("click",E,u),y(p,v)};K(f,p=>{t()&&p(g)})}y(n,d),ve()}ye(["click"]);var F1=P('<span class="text-destructive">*</span>'),L1=P('<p class="mt-1 text-xs text-muted-foreground"> </p>'),R1=P('<p class="mt-1 text-xs text-destructive"> </p>'),z1=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="text"/> <!> <!></div>');function sl(n,e){he(e,!0);let t=se(e,"value",15);var r=z1(),i=_(r),o=_(i),s=T(o);{var a=p=>{var v=F1();y(p,v)};K(s,p=>{e.field.required&&p(a)})}var u=T(i,2),c=T(u,2);{var d=p=>{var v=L1(),m=_(v);J(()=>$(m,`Max ${e.field.maxLength??""} characters`)),y(p,v)};K(c,p=>{e.field.maxLength&&p(d)})}var f=T(c,2);{var g=p=>{var v=R1(),m=_(v);J(()=>$(m,e.error)),y(p,v)};K(f,p=>{e.error&&p(g)})}J(()=>{X(i,"for",e.field.name),$(o,`${e.field.label??""} `),X(u,"id",e.field.name),Ee(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(u,"placeholder",e.field.label),X(u,"minlength",e.field.minLength),X(u,"maxlength",e.field.maxLength),X(u,"pattern",e.field.pattern)}),Mt(u,t),y(n,r),ve()}var B1=P('<span class="text-destructive">*</span>'),U1=P('<p class="mt-1 text-xs text-destructive"> </p>'),j1=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <textarea></textarea> <!></div>');function W1(n,e){he(e,!0);let t=se(e,"value",15);var r=j1(),i=_(r),o=_(i),s=T(o);{var a=f=>{var g=B1();y(f,g)};K(s,f=>{e.field.required&&f(a)})}var u=T(i,2);X(u,"rows",4);var c=T(u,2);{var d=f=>{var g=U1(),p=_(g);J(()=>$(p,e.error)),y(f,g)};K(c,f=>{e.error&&f(d)})}J(()=>{X(i,"for",e.field.name),$(o,`${e.field.label??""} `),X(u,"id",e.field.name),Ee(u,1,`w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(u,"placeholder",e.field.label),X(u,"minlength",e.field.minLength),X(u,"maxlength",e.field.maxLength)}),Mt(u,t),y(n,r),ve()}var K1=P('<span class="text-destructive">*</span>'),H1=P('<p class="mt-1 text-xs text-destructive"> </p>'),V1=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="number"/> <!></div>');function J1(n,e){he(e,!0);let t=se(e,"value",15);function r(g){const v=g.target.value;t(v===""?null:e.field.integerOnly?parseInt(v,10):parseFloat(v))}var i=V1(),o=_(i),s=_(o),a=T(s);{var u=g=>{var p=K1();y(g,p)};K(a,g=>{e.field.required&&g(u)})}var c=T(o,2),d=T(c,2);{var f=g=>{var p=H1(),v=_(p);J(()=>$(v,e.error)),y(g,p)};K(d,g=>{e.error&&g(f)})}J(()=>{X(o,"for",e.field.name),$(s,`${e.field.label??""} `),X(c,"id",e.field.name),ir(c,t()??""),X(c,"min",e.field.min),X(c,"max",e.field.max),X(c,"step",e.field.integerOnly?1:"any"),Ee(c,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(c,"placeholder",e.field.label)}),ee("input",c,r),y(n,i),ve()}ye(["input"]);var q1=P('<span class="text-destructive">*</span>'),G1=P('<p class="mt-1 text-xs text-destructive"> </p>'),Y1=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="email"/> <!></div>');function Z1(n,e){he(e,!0);let t=se(e,"value",15);var r=Y1(),i=_(r),o=_(i),s=T(o);{var a=f=>{var g=q1();y(f,g)};K(s,f=>{e.field.required&&f(a)})}var u=T(i,2),c=T(u,2);{var d=f=>{var g=G1(),p=_(g);J(()=>$(p,e.error)),y(f,g)};K(c,f=>{e.error&&f(d)})}J(()=>{X(i,"for",e.field.name),$(o,`${e.field.label??""} `),X(u,"id",e.field.name),Ee(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(u,"placeholder",e.field.label)}),Mt(u,t),y(n,r),ve()}var X1=P('<span class="text-destructive">*</span>'),Q1=P("<option> </option>"),$1=P('<p class="mt-1 text-xs text-destructive"> </p>'),ew=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <select><option> </option><!></select> <!></div>');function tw(n,e){he(e,!0);let t=se(e,"value",15);var r=ew(),i=_(r),o=_(i),s=T(o);{var a=v=>{var m=X1();y(v,m)};K(s,v=>{e.field.required&&v(a)})}var u=T(i,2),c=_(u),d=_(c);c.value=c.__value="";var f=T(c);Ue(f,17,()=>e.field.options||[],ut,(v,m)=>{var h=Q1(),w=_(h),b={};J(()=>{$(w,l(m).label||l(m).value),b!==(b=l(m).value)&&(h.value=(h.__value=l(m).value)??"")}),y(v,h)});var g=T(u,2);{var p=v=>{var m=$1(),h=_(m);J(()=>$(h,e.error)),y(v,m)};K(g,v=>{e.error&&v(p)})}J(()=>{X(i,"for",e.field.name),$(o,`${e.field.label??""} `),X(u,"id",e.field.name),Ee(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),$(d,`Select ${e.field.label??""}`)}),ah(u,t),y(n,r),ve()}var nw=P('<p class="mt-1 text-xs text-destructive"> </p>'),rw=P('<div><label class="flex items-center gap-2 cursor-pointer"><input type="checkbox" class="h-4 w-4 rounded border accent-primary"/> <span class="text-sm font-medium"> </span></label> <!></div>');function iw(n,e){he(e,!0);let t=se(e,"value",15);var r=rw(),i=_(r),o=_(i),s=T(o,2),a=_(s),u=T(i,2);{var c=d=>{var f=nw(),g=_(f);J(()=>$(g,e.error)),y(d,f)};K(u,d=>{e.error&&d(c)})}J(()=>$(a,e.field.label)),Hu(o,t),y(n,r),ve()}var ow=P('<span class="text-destructive">*</span>'),sw=P('<p class="mt-1 text-xs text-destructive"> </p>'),aw=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="datetime-local"/> <!></div>');function lw(n,e){he(e,!0);let t=se(e,"value",15);function r(v){if(!v)return"";const m=new Date(v);if(isNaN(m.getTime()))return"";const h=w=>String(w).padStart(2,"0");return`${m.getFullYear()}-${h(m.getMonth()+1)}-${h(m.getDate())}T${h(m.getHours())}:${h(m.getMinutes())}`}let i=z(()=>r(t()));function o(v){const m=v.target.value;if(!m){t(null);return}const h=new Date(m);t(isNaN(h.getTime())?null:h.toISOString())}var s=aw(),a=_(s),u=_(a),c=T(u);{var d=v=>{var m=ow();y(v,m)};K(c,v=>{e.field.required&&v(d)})}var f=T(a,2),g=T(f,2);{var p=v=>{var m=sw(),h=_(m);J(()=>$(h,e.error)),y(v,m)};K(g,v=>{e.error&&v(p)})}J(()=>{X(a,"for",e.field.name),$(u,`${e.field.label??""} `),X(f,"id",e.field.name),ir(f,l(i)),Ee(f,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),ee("input",f,o),y(n,s),ve()}ye(["input"]);function de(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Oh(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Kn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,uw=Kn&&"documentMode"in document?document.documentMode:null,Fn=Kn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Br=Kn&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ra=!(!Kn||!("InputEvent"in window)||uw)&&"getTargetRanges"in new window.InputEvent("input"),ls=Kn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),po=Kn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,cw=Kn&&/Android/.test(navigator.userAgent),Dh=Kn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ld=Kn&&cw&&Dh,us=Kn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Fn&&!Dh,dw=0,fw=1,gw=2,Ih=128,hw=1,vw=2,pw=3,mw=4,_w=5,bw=6,Ea=ls||po||us?" ":"",Na=`
|
|
16
|
-
|
|
17
|
-
`,yw=Br?" ":Ea,li={bold:1,capitalize:1024,code:16,highlight:Ih,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},xw={directionless:1,unmergeable:2},ud={center:2,end:6,justify:4,left:1,right:3,start:5},ww={[vw]:"center",[bw]:"end",[mw]:"justify",[hw]:"left",[pw]:"right",[_w]:"start"},kw={normal:0,segmented:2,token:1},Sw={[dw]:"normal",[gw]:"segmented",[fw]:"token"},cd="$config";function Fh(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===e&&(oe(s)&&Fh(s,a,t,r,i,o),t.has(a)||o.delete(a),i.push(a)),s=s.getNextSibling()}}let ql=!1,Zu=0;function Cw(n){Zu=n.timeStamp}function al(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Ua(n,t)!==void 0}function Tw(n,e,t){const r=Hn(Dn(t));let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&pc(e,s,i,o,!1)}function Ew(n,e,t){if(ue(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Tr(e)&&t.isAttached()}function Nw(n,e,t,r){for(let i=n;i&&!N2(i);i=gs(i)){const o=Ua(i,e);if(o!==void 0){const s=St(o,t);if(s)return ct(s)||!Ft(i)?void 0:[i,s]}else if(i===r)return[r,Lv(t)]}}function Lh(n,e,t){ql=!0;const r=performance.now()-Zu>100;try{er(n,()=>{const i=be()||(function(g){return g.getEditorState().read(()=>{const p=be();return p!==null?p.clone():null})})(n),o=new Map,s=n.getRootElement(),a=n._editorState,u=n._blockCursorElement;let c=!1,d="";for(let g=0;g<e.length;g++){const p=e[g],v=p.type,m=p.target,h=Nw(m,n,a,s);if(!h)continue;const[w,b]=h;if(v==="characterData")r&&Se(b)&&Tr(m)&&Ew(i,m,b)&&Tw(m,b,n);else if(v==="childList"){c=!0;const x=p.addedNodes;for(let C=0;C<x.length;C++){const N=x[C],O=Iv(N),E=N.parentNode;if(E!=null&&N!==u&&O===null&&!al(N,E,n)){if(Br){const D=(Ft(N)?N.innerText:null)||N.nodeValue;D&&(d+=D)}E.removeChild(N)}}const S=p.removedNodes,k=S.length;if(k>0){let C=0;for(let N=0;N<k;N++){const O=S[N];(al(O,m,n)||u===O)&&(m.appendChild(O),C++)}k!==C&&o.set(w,b)}}}if(o.size>0)for(const[g,p]of o)p.reconcileObservedMutation(g,n);const f=t.takeRecords();if(f.length>0){for(let g=0;g<f.length;g++){const p=f[g],v=p.addedNodes,m=p.target;for(let h=0;h<v.length;h++){const w=v[h],b=w.parentNode;b==null||w.nodeName!=="BR"||al(w,m,n)||b.removeChild(w)}}t.takeRecords()}i!==null&&(c&&Zt(i),Br&&Uv(n)&&i.insertRawText(d))})}finally{ql=!1}}function Rh(n){const e=n._observer;e!==null&&Lh(n,e.takeRecords(),e)}function zh(n){(function(e){Zu===0&&Dn(e).addEventListener("textInput",Cw,!0)})(n),n._observer=new MutationObserver((e,t)=>{Lh(n,e,t)})}function Bh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=Wa(r);if(i&&i.stateConfigs)for(const o of i.stateConfigs){let s;"stateConfig"in o?(s=o.stateConfig,o.flat&&t.add(s.key)):s=o,e.set(s.key,s)}}return{flatKeys:t,sharedConfigMap:e}}class Xu{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,o=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:s}=this.sharedNodeState,a=o!==void 0?o:(function(u,c,d){let f=d.size;if(c)for(const g in c){const p=u.get(g);p&&d.has(p)||f++}return f})(s,r,i);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return dd(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new Xu(e,t,(function(o,s,a){let u;if(a)for(const[c,d]of Object.entries(a)){const f=o.get(c);f?s.has(f)||s.set(f,f.parse(d)):(u=u||{},u[c]=d)}return u})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:o}=this;i.has(e)||o&&r in o||(o&&(delete o[r],this.unknownState=dd(o)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}}function Aw(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Xu(e,Uh(e));return e.__state=t,t}function Uh(n){return n.__state?n.__state.sharedNodeState:Av(ja(),n.getType()).sharedNodeState}function dd(n){if(n)for(const e in n)return n}function fd(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const o=t?t.getValue(r):r.defaultValue;if(o!==i&&!r.isEqual(o,i))return!0}return!1}function gd(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[o,s]of Object.entries(r))if(!n.has(o)&&(n.add(o),s!==(i?i[o]:void 0)))return!0}return!1}function hd(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function vd(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,a=e.__style,u=n.__state,c=e.__state;return(t===null||t===o)&&(r===null||r===s)&&(i===null||i===a)&&(n.__state===null||u===c||(function(d,f){if(d===f)return!0;if(d&&f&&d.size!==f.size)return!1;const g=new Set;return!(d&&fd(g,d,f)||f&&fd(g,f,d)||d&&gd(g,d,f)||f&&gd(g,f,d))})(u,c))}function pd(n,e){const t=n.mergeWithSibling(e),r=mt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function md(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&Se(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(vd(e,r)){r=pd(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&Se(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(vd(r,t)){r=pd(r,t);break}break}t.remove()}}else r.remove()}function ro(n){return _d(n.anchor),_d(n.focus),n}function _d(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),Se(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!oe(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let ui,$t,Jo,Aa,Gl,Yl,ci,Bn,Zl,qo,Lt="",Jn=null,Yr=null,Fi=!1,ia=!1;function oa(n,e){const t=ci.get(n);if(e!==null){const r=eu(n);r.parentNode===e&&e.removeChild(r)}if(Bn.has(n)||$t._keyToDOMMap.delete(n),oe(t)){const r=aa(t,ci);Xl(r,0,r.length-1,null)}t!==void 0&&mc(qo,Jo,Aa,t,"destroyed")}function Xl(n,e,t,r){for(let i=e;i<=t;++i){const o=n[i];o!==void 0&&oa(o,r)}}function Jr(n,e){n.setProperty("text-align",e)}const Mw="40px";function jh(n,e){const t=ui.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Mw;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Wh(n,e){const t=n.style;e===0?Jr(t,""):e===1?Jr(t,"left"):e===2?Jr(t,"center"):e===3?Jr(t,"right"):e===4?Jr(t,"justify"):e===5?Jr(t,"start"):e===6&&Jr(t,"end")}function Ql(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(zt(r))return null;const o=r.getParentOrThrow();return zt(o)&&o.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function sa(n,e){const t=Bn.get(n);t===void 0&&de(60);const r=t.createDOM(ui,$t);if((function(i,o,s){const a=s._keyToDOMMap;(function(u,c,d){const f=`__lexicalKey_${c._key}`;u[f]=d})(o,s,i),a.set(i,o)})(n,r,$t),Se(t)?r.setAttribute("data-lexical-text","true"):ct(t)&&r.setAttribute("data-lexical-decorator","true"),oe(t)){const i=t.__indent,o=t.__size;if(Ql(r,t),i!==0&&jh(r,i),o!==0){const a=o-1;$l(aa(t,Bn),t,0,a,t.getDOMSlot(r))}const s=t.__format;s!==0&&Wh(r,s),t.isInline()||Kh(null,t,r)}else{const i=t.getTextContent();if(ct(t)){const o=t.decorate($t,ui);o!==null&&Hh(n,o),r.contentEditable="false"}Lt+=i}return e!==null&&e.insertChild(r),mc(qo,Jo,Aa,t,"created"),r}function $l(n,e,t,r,i){const o=Lt;Lt="";let s=t;for(;s<=r;++s){sa(n[s],i);const a=Bn.get(n[s]);a!==null&&Se(a)?Jn===null&&(Jn=a.getFormat(),Yr=a.getStyle()):oe(a)&&s<r&&!a.isInline()&&(Lt+=Na)}i.element.__lexicalTextContent=Lt,Lt=o+Lt}function bd(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Yi(r)?"line-break":ct(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Kh(n,e,t){const r=bd(n,ci),i=bd(e,Bn);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Pw(n,e,t){var r;Jn=null,Yr=null,(function(i,o,s){const a=Lt,u=i.__size,c=o.__size;Lt="";const d=s.element;if(u===1&&c===1){const f=i.__first,g=o.__first;if(f===g)js(f,d);else{const v=eu(f),m=sa(g,null);try{d.replaceChild(m,v)}catch(h){if(typeof h=="object"&&h!=null){const w=`${h.toString()} Parent: ${d.tagName}, new child: {tag: ${m.tagName} key: ${g}}, old child: {tag: ${v.tagName}, key: ${f}}.`;throw new Error(w)}throw h}oa(f,null)}const p=Bn.get(g);Se(p)&&Jn===null&&(Jn=p.getFormat(),Yr=p.getStyle())}else{const f=aa(i,ci),g=aa(o,Bn);if(f.length!==u&&de(227),g.length!==c&&de(228),u===0)c!==0&&$l(g,0,0,c-1,s);else if(c===0){if(u!==0){const p=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Xl(f,0,u-1,p?null:d),p&&(d.textContent="")}}else(function(p,v,m,h,w,b){const x=h-1,S=w-1;let k,C,N=b.getFirstChild(),O=0,E=0;for(;O<=x&&E<=S;){const V=v[O],G=m[E];if(V===G)N=ll(js(G,b.element)),O++,E++;else{if(C===void 0&&(C=yd(m,E)),k===void 0)k=yd(v,O);else if(!k.has(V)){O++;continue}if(!C.has(V)){N=ll(eu(V)),oa(V,b.element),O++,k.delete(V);continue}if(k.has(G)){const M=di($t,G);M!==N&&b.withBefore(N).insertChild(M),N=ll(js(G,b.element)),O++,E++}else sa(G,b.withBefore(N)),E++}const U=Bn.get(G);U!==null&&Se(U)?Jn===null&&(Jn=U.getFormat(),Yr=U.getStyle()):oe(U)&&E<=S&&!U.isInline()&&(Lt+=Na)}const D=O>x,L=E>S;if(D&&!L){const V=m[S+1],G=V===void 0?null:$t.getElementByKey(V);$l(m,0,E,S,b.withBefore(G))}else L&&!D&&Xl(v,O,x,b.element)})(0,f,g,u,c,s)}d.__lexicalTextContent=Lt,Lt=a+Lt})(n,e,e.getDOMSlot(t)),r=e,Jn==null||Jn===r.__textFormat||ia||r.setTextFormat(Jn),(function(i){Yr==null||Yr===i.__textStyle||ia||i.setTextStyle(Yr)})(e)}function aa(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&de(101),t.push(r),r=i.__next}return t}function js(n,e){const t=ci.get(n);let r=Bn.get(n);t!==void 0&&r!==void 0||de(61);const i=Fi||Yl.has(n)||Gl.has(n),o=di($t,n);if(t===r&&!i){let s;if(oe(t)){const a=o.__lexicalTextContent;typeof a=="string"?s=a:(s=t.getTextContent(),o.__lexicalTextContent=s)}else s=t.getTextContent();return Lt+=s,o}if(t!==r&&i&&mc(qo,Jo,Aa,r,"updated"),r.updateDOM(t,o,ui)){const s=sa(n,null);return e===null&&de(62),e.replaceChild(s,o),oa(n,null),s}if(oe(t)){oe(r)||de(334,n);const s=r.__indent;(Fi||s!==t.__indent)&&jh(o,s);const a=r.__format;if((Fi||a!==t.__format)&&Wh(o,a),i)Pw(t,r,o),zt(r)||r.isInline()||Kh(t,r,o);else{const u=o.__lexicalTextContent;let c;typeof u=="string"?c=u:(c=t.getTextContent(),o.__lexicalTextContent=c),Lt+=c}if((Fi||r.__dir!==t.__dir)&&(Ql(o,r),zt(r)&&!Fi))for(const u of r.getChildren())oe(u)&&Ql(di($t,u.getKey()),u)}else{const s=r.getTextContent();if(ct(r)){const a=r.decorate($t,ui);a!==null&&Hh(n,a)}Lt+=s}if(!ia&&zt(r)&&r.__cachedText!==Lt){const s=r.getWritable();s.__cachedText=Lt,r=s}return o}function Hh(n,e){let t=$t._pendingDecorators;const r=$t._decorators;if(t===null){if(r[n]===e)return;t=Fv($t)}t[n]=e}function ll(n){let e=n.nextSibling;return e!==null&&e===$t._blockCursorElement&&(e=e.nextSibling),e}function yd(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Ow(n,e,t,r,i,o){Lt="",Fi=r===2,$t=t,ui=t._config,Jo=t._nodes,Aa=$t._listeners.mutation,Gl=i,Yl=o,ci=n._nodeMap,Bn=e._nodeMap,ia=e._readOnly,Zl=new Map(t._keyToDOMMap);const s=new Map;return qo=s,js("root",null),$t=void 0,Jo=void 0,Gl=void 0,Yl=void 0,ci=void 0,Bn=void 0,ui=void 0,Zl=void 0,qo=void 0,s}function eu(n){const e=Zl.get(n);return e===void 0&&de(75,n),e}function Le(n){return{type:n}}const Ma=Le("SELECTION_CHANGE_COMMAND"),Dw=Le("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Pa=Le("CLICK_COMMAND"),Vh=Le("BEFORE_INPUT_COMMAND"),Jh=Le("INPUT_COMMAND"),qh=Le("COMPOSITION_START_COMMAND"),Gh=Le("COMPOSITION_END_COMMAND"),ni=Le("DELETE_CHARACTER_COMMAND"),Ji=Le("INSERT_LINE_BREAK_COMMAND"),Go=Le("INSERT_PARAGRAPH_COMMAND"),qi=Le("CONTROLLED_TEXT_INSERTION_COMMAND"),Oa=Le("PASTE_COMMAND"),tu=Le("REMOVE_TEXT_COMMAND"),Yo=Le("DELETE_WORD_COMMAND"),Zo=Le("DELETE_LINE_COMMAND"),kn=Le("FORMAT_TEXT_COMMAND"),Da=Le("UNDO_COMMAND"),Ia=Le("REDO_COMMAND"),Yh=Le("KEYDOWN_COMMAND"),Zh=Le("KEY_ARROW_RIGHT_COMMAND"),Iw=Le("MOVE_TO_END"),Xh=Le("KEY_ARROW_LEFT_COMMAND"),Fw=Le("MOVE_TO_START"),Qh=Le("KEY_ARROW_UP_COMMAND"),$h=Le("KEY_ARROW_DOWN_COMMAND"),Xo=Le("KEY_ENTER_COMMAND"),ev=Le("KEY_SPACE_COMMAND"),tv=Le("KEY_BACKSPACE_COMMAND"),Qu=Le("KEY_ESCAPE_COMMAND"),nv=Le("KEY_DELETE_COMMAND"),rv=Le("KEY_TAB_COMMAND"),Lw=Le("INSERT_TAB_COMMAND"),Rw=Le("INDENT_CONTENT_COMMAND"),xd=Le("OUTDENT_CONTENT_COMMAND"),iv=Le("DROP_COMMAND"),ov=Le("FORMAT_ELEMENT_COMMAND"),$u=Le("DRAGSTART_COMMAND"),sv=Le("DRAGOVER_COMMAND"),zw=Le("DRAGEND_COMMAND"),Fa=Le("COPY_COMMAND"),ec=Le("CUT_COMMAND"),nu=Le("SELECT_ALL_COMMAND"),Bw=Le("CLEAR_EDITOR_COMMAND"),Uw=Le("CLEAR_HISTORY_COMMAND"),Es=Le("CAN_REDO_COMMAND"),Ns=Le("CAN_UNDO_COMMAND"),jw=Le("FOCUS_COMMAND"),Ww=Le("BLUR_COMMAND"),Kw=Le("KEY_MODIFIER_COMMAND"),dr=Object.freeze({}),ru=[["keydown",function(n,e){Qo=n.timeStamp,av=n.key,!e.isComposing()&&Ne(e,Yh,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;yo(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&er(e,()=>{Mv(t)||(su=!0)})}],["compositionstart",function(n,e){Ne(e,qh,n)}],["compositionend",function(n,e){Br?Mo=!0:po||!ls&&!us?Ne(e,Gh,n):(au=!0,lu=n.data)}],["input",function(n,e){n.stopPropagation(),er(e,()=>{e.dispatchCommand(Jh,n)},{event:n}),Li=null}],["click",function(n,e){er(e,()=>{const t=be(),r=Hn(Dn(e)),i=bo();if(r){if(ue(t)){const o=t.anchor,s=o.getNode();if(o.type==="element"&&o.offset===0&&t.isCollapsed()&&!zt(s)&&Pt().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()){const a=rn(s,u=>oe(u)&&!u.isInline());oe(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const o=r.anchorNode;(Ft(o)||Tr(o))&&Zt(ic(i,r,e,n))}}Ne(e,Pa,n)})}],["cut",dr],["copy",dr],["dragstart",dr],["dragover",dr],["dragend",dr],["paste",dr],["focus",dr],["blur",dr],["drop",dr]];ra&&ru.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||Br&&Uv(r)||i!=="insertCompositionText"&&Ne(r,Vh,t)})(n,e)]);let Qo=0,av=null,lv=0,Li=null;const iu=new WeakMap,la=new WeakMap;let ou=!1,su=!1,Fo=!1,Mo=!1,au=!1,lu="",Zr=null,uv=[0,"",0,"root",0];function cv(n,e,t,r,i){const o=n.anchor,s=n.focus,a=o.getNode(),u=mt(),c=Hn(Dn(u)),d=c!==null?c.anchorNode:null,f=o.key,g=u.getElementByKey(f),p=t.length;return f!==s.key||!Se(a)||(!i&&(!ra||lv<r+50)||a.isDirty()&&p<2||Rv(t))&&o.offset!==s.offset&&!a.isComposing()||vr(a)||a.isDirty()&&p>1||(i||!ra)&&g!==null&&!a.isComposing()&&d!==oo(g)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(v,m){if(m.isSegmented())return!0;if(!v.isCollapsed())return!1;const h=v.anchor.offset,w=m.getParentOrThrow(),b=ii(m);return h===0?!m.canInsertTextBefore()||!w.canInsertTextBefore()&&!m.isComposing()||b||(function(x){const S=x.getPreviousSibling();return(Se(S)||oe(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):h===m.getTextContentSize()&&(!m.canInsertTextAfter()||!w.canInsertTextAfter()&&!m.isComposing()||b)})(n,a)}function wd(n,e){return Tr(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function kd(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;ou&&(ou=!1,wd(r,i)&&wd(o,s)&&!Zr)||er(e,()=>{if(!t)return void Zt(null);if(!fs(e,r,o))return;let a=be();if(Zr&&ue(a)&&a.isCollapsed()){const u=a.anchor,c=Zr.anchor;(u.key===c.key&&u.offset===c.offset+1||u.offset===1&&c.getNode().is(u.getNode().getPreviousSibling()))&&(a=Zr.clone(),Zt(a))}if(Zr=null,ue(a)){const u=a.anchor,c=u.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const d=Dn(e).event,f=d?d.timeStamp:performance.now(),[g,p,v,m,h]=uv,w=Pt(),b=e.isComposing()===!1&&w.getTextContent()==="";if(f<h+200&&u.offset===v&&u.key===m)Ws(a,g,p);else if(u.type==="text")Se(c)||de(141),dv(a,c);else if(u.type==="element"&&!b){oe(c)||de(259);const x=u.getNode();x.isEmpty()?(function(S,k){const C=k.getTextFormat(),N=k.getTextStyle();Ws(S,C,N)})(a,x):Ws(a,0,"")}}else{const d=u.key,f=a.focus.key,g=a.getNodes(),p=g.length,v=a.isBackward(),m=v?s:i,h=v?i:s,w=v?f:d,b=v?d:f;let x=2047,S=!1;for(let k=0;k<p;k++){const C=g[k],N=C.getTextContentSize();if(Se(C)&&N!==0&&!(k===0&&C.__key===w&&m===N||k===p-1&&C.__key===b&&h===0)&&(S=!0,x&=C.getFormat(),x===0))break}a.format=S?x:0}}Ne(e,Ma,void 0)})}function Ws(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function dv(n,e){Ws(n,e.getFormat(),e.getStyle())}function fv(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Hw(n){const e=n.inputType,t=fv(n),r=mt(),i=be();if(e==="deleteContentBackward"){if(i===null){const f=bo();if(!ue(f))return!0;Zt(f.clone())}if(ue(i)){const f=i.anchor.key===i.focus.key;if(o=n.timeStamp,av==="MediaLast"&&o<Qo+30&&r.isComposing()&&f){if(Vt(null),Qo=0,setTimeout(()=>{er(r,()=>{Vt(null)})},30),ue(i)){const g=i.anchor.getNode();g.markDirty(),Se(g)||de(142),dv(i,g)}}else{Vt(null),n.preventDefault();const g=i.anchor.getNode(),p=g.getTextContent(),v=g.canInsertTextAfter(),m=i.anchor.offset===0&&i.focus.offset===p.length;let h=ld&&f&&!m&&v;if(h&&i.isCollapsed()&&(h=!ct(hu(i.anchor,!0))),!h){Ne(r,ni,!0);const w=be();ld&&ue(w)&&w.isCollapsed()&&(Zr=w,setTimeout(()=>Zr=null))}}return!0}}var o;if(!ue(i))return!0;const s=n.data;Li!==null&&vc(!1,r,Li),i.dirty&&Li===null||!i.isCollapsed()||zt(i.anchor.getNode())||t===null||i.applyDOMRange(t),Li=null;const a=i.anchor,u=i.focus,c=a.getNode(),d=u.getNode();if(e==="insertText"||e==="insertTranspose"){if(s===`
|
|
18
|
-
`)n.preventDefault(),Ne(r,Ji,!1);else if(s===Na)n.preventDefault(),Ne(r,Go,void 0);else if(s==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else s!=null&&cv(i,t,s,n.timeStamp,!0)?(n.preventDefault(),Ne(r,qi,s)):Li=s;return lv=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ne(r,qi,n);break;case"insertFromComposition":Vt(null),Ne(r,qi,n);break;case"insertLineBreak":Vt(null),Ne(r,Ji,!1);break;case"insertParagraph":Vt(null),Fo&&!po?(Fo=!1,Ne(r,Ji,!1)):Ne(r,Go,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ne(r,Oa,n);break;case"deleteByComposition":(function(f,g){return f!==g||oe(f)||oe(g)||!ii(f)||!ii(g)})(c,d)&&Ne(r,tu,n);break;case"deleteByDrag":case"deleteByCut":Ne(r,tu,n);break;case"deleteContent":Ne(r,ni,!1);break;case"deleteWordBackward":Ne(r,Yo,!0);break;case"deleteWordForward":Ne(r,Yo,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ne(r,Zo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ne(r,Zo,!1);break;case"formatStrikeThrough":Ne(r,kn,"strikethrough");break;case"formatBold":Ne(r,kn,"bold");break;case"formatItalic":Ne(r,kn,"italic");break;case"formatUnderline":Ne(r,kn,"underline");break;case"historyUndo":Ne(r,Da,void 0);break;case"historyRedo":Ne(r,Ia,void 0)}return!0}function Vw(n){if(Ft(n.target)&&Mv(n.target))return!0;const e=mt(),t=be(),r=n.data,i=fv(n);if(r!=null&&ue(t)&&cv(t,i,r,n.timeStamp,!1)){Mo&&(ua(e,r),Mo=!1);const o=t.anchor.getNode(),s=Hn(Dn(e));if(s===null)return!0;const a=t.isBackward(),u=a?t.anchor.offset:t.focus.offset,c=a?t.focus.offset:t.anchor.offset;ra&&!t.isCollapsed()&&Se(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,u)+r+o.getTextContent().slice(u+c)===Bv(s.anchorNode)||Ne(e,qi,r);const d=r.length;Br&&d>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=d),ls||po||us||!e.isComposing()||(Qo=0,Vt(null))}else vc(!1,e,r!==null?r:void 0),Mo&&(ua(e,r||void 0),Mo=!1);return(function(){Ht();const o=mt();Rh(o)})(),!0}function Jw(n){const e=mt(),t=be();if(ue(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Vt(r.key),(n.timeStamp<Qo+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||Se(i)&&i.getStyle()!==t.style)&&Ne(e,qi,yw)}return!0}function qw(n){return ua(mt(),n.data),!0}function ua(n,e){const t=n._compositionKey;if(Vt(null),t!==null&&e!=null){if(e===""){const r=St(t),i=oo(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&Se(r)&&pc(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
19
|
-
`){const r=be();if(ue(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void Ne(n,Xo,null)}}}vc(!0,n,e)}function Gw(n){const e=mt();if(n.key==null)return!0;if(au&&Yd(n))return er(e,()=>{ua(e,lu)}),au=!1,lu="",!0;if((function(t){return ht(t,"ArrowRight",{shiftKey:"any"})})(n))Ne(e,Zh,n);else if((function(t){return ht(t,"ArrowRight",gr)})(n))Ne(e,Iw,n);else if((function(t){return ht(t,"ArrowLeft",{shiftKey:"any"})})(n))Ne(e,Xh,n);else if((function(t){return ht(t,"ArrowLeft",gr)})(n))Ne(e,Fw,n);else if((function(t){return ht(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))Ne(e,Qh,n);else if((function(t){return ht(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))Ne(e,$h,n);else if((function(t){return ht(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Fo=!0,Ne(e,Xo,n);else if((function(t){return t.key===" "})(n))Ne(e,ev,n);else if((function(t){return Fn&&ht(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Fo=!0,Ne(e,Ji,!0);else if((function(t){return ht(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Fo=!1,Ne(e,Xo,n);else if((function(t){return ht(t,"Backspace",{shiftKey:"any"})||Fn&&ht(t,"h",{ctrlKey:!0})})(n))Yd(n)?Ne(e,tv,n):(n.preventDefault(),Ne(e,ni,!0));else if((function(t){return t.key==="Escape"})(n))Ne(e,Qu,n);else if((function(t){return ht(t,"Delete",{})||Fn&&ht(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?Ne(e,nv,n):(n.preventDefault(),Ne(e,ni,!1));else if((function(t){return ht(t,"Backspace",Gd)})(n))n.preventDefault(),Ne(e,Yo,!0);else if((function(t){return ht(t,"Delete",Gd)})(n))n.preventDefault(),Ne(e,Yo,!1);else if((function(t){return Fn&&ht(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),Ne(e,Zo,!0);else if((function(t){return Fn&&(ht(t,"Delete",{metaKey:!0})||ht(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),Ne(e,Zo,!1);else if((function(t){return ht(t,"b",gr)})(n))n.preventDefault(),Ne(e,kn,"bold");else if((function(t){return ht(t,"u",gr)})(n))n.preventDefault(),Ne(e,kn,"underline");else if((function(t){return ht(t,"i",gr)})(n))n.preventDefault(),Ne(e,kn,"italic");else if((function(t){return ht(t,"Tab",{shiftKey:"any"})})(n))Ne(e,rv,n);else if((function(t){return ht(t,"z",gr)})(n))n.preventDefault(),Ne(e,Da,void 0);else if((function(t){return Fn?ht(t,"z",{metaKey:!0,shiftKey:!0}):ht(t,"y",{ctrlKey:!0})||ht(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),Ne(e,Ia,void 0);else{const t=e._editorState._selection;t===null||ue(t)?Zd(n)&&(n.preventDefault(),Ne(e,nu,n)):(function(r){return ht(r,"c",gr)})(n)?(n.preventDefault(),Ne(e,Fa,n)):(function(r){return ht(r,"x",gr)})(n)?(n.preventDefault(),Ne(e,ec,n)):Zd(n)&&(n.preventDefault(),Ne(e,nu,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(Kw,n),!0}function gv(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Gi=new Map;function hv(n){const e=C2(n.target);if(e===null)return;const t=Pv(e.anchorNode);if(t===null)return;su&&(su=!1,er(t,()=>{const u=bo(),c=e.anchorNode;(Ft(c)||Tr(c))&&Zt(ic(u,e,t,n))}));const r=hc(t),i=r[r.length-1],o=i._key,s=Gi.get(o),a=s||i;a!==t&&kd(e,a,!1),kd(e,t,!0),t!==i?Gi.set(o,t):s&&Gi.delete(o)}function Sd(n){n._lexicalHandled=!0}function Cd(n){return n._lexicalHandled===!0}function Yw(n){const e=iu.get(n);if(e===void 0)return;const t=la.get(e);if(t===void 0)return;const r=t-1;r>=0||de(164),iu.delete(n),la.set(e,r),r===0&&e.removeEventListener("selectionchange",hv);const i=Ba(n);gc(i)?((function(s){if(s._parentEditor!==null){const a=hc(s),u=a[a.length-1]._key;Gi.get(u)===s&&Gi.delete(u)}else Gi.delete(s._key)})(i),n.__lexicalEditor=null):i&&de(198);const o=gv(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function uu(n,e,t){Ht();const r=n.__key,i=n.getParent();if(i===null)return;const o=(function(a){const u=be();if(!ue(u)||!oe(a))return u;const{anchor:c,focus:d}=u,f=c.getNode(),g=d.getNode();return vu(f,a)&&c.set(a.__key,0,"element"),vu(g,a)&&d.set(a.__key,0,"element"),u})(n);let s=!1;if(ue(o)&&e){const a=o.anchor,u=o.focus;a.key===r&&(fa(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),u.key===r&&(fa(u,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else Et(o)&&e&&n.isSelected()&&n.selectPrevious();if(ue(o)&&e&&!s){const a=n.getIndexWithinParent();oi(n),da(o,i,a,-1)}else oi(n);t||un(i)||i.canBeEmpty()||!i.isEmpty()||uu(i,e),e&&o&&zt(i)&&i.isEmpty()&&i.selectEnd()}const vv=Symbol.for("ephemeral");function ca(n){return n[vv]||!1}class $n{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=Wa(this);return e===void 0&&de(64,this.name),e}static clone(e){de(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),_2(this,e)}getType(){return this.__type}isInline(){de(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=St(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||be();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(Se(this))return r;if(ue(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(ct(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor;if(i.is(o.getNode())&&o.offset===i.getChildrenSize()&&this.is(i.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:St(e)}getParentOrThrow(){const e=this.getParent();return e===null&&de(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(un(t))return oe(e)||e===this&&ct(e)||de(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&de(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:St(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:St(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=oe(this)?this:this.getParent(),r=oe(e)?e:e.getParent(),i=t&&r?Hs(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=Hs(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?Jv(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&de(279),!1)))}isParentOf(e){const t=Hs(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const a=oe(o)?t?o.getFirstChild():o.getLastChild():null;if(a!==null){o=a;continue}const u=t?o.getNextSibling():o.getPreviousSibling();if(u!==null){o=u;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let d=null,f=c;do{if(f===null&&de(68),d=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;d!==null||i.has(f.__key)||r.push(f)}while(d===null);o=d}return t||r.reverse(),r}isDirty(){const e=mt()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ca(this))return this;const e=St(this.__key);return e===null&&de(113),e}getWritable(){if(ca(this))return this;Ht();const e=Kr(),t=mt(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,a=be();if(a!==null&&a.setCachedNodes(null),s.has(i))return ha(o),o;const u=Kv(o);return s.add(i),ha(u),r.set(i,u),u}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){de(70)}updateDOM(e,t,r){de(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){de(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),o=r.$;let s=o;for(const a of Uh(i).flatKeys)a in r&&(s!==void 0&&s!==o||(s={...o}),s[a]=r[a]);return(i.__state||s)&&Aw(t).updateFromJSON(s),i})(this,e)}static transform(){return null}remove(e){uu(this,!0,e)}replace(e,t){Ht();let r=be();r!==null&&(r=r.clone()),hl(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,a=e.getWritable(),u=this.getParentOrThrow().getWritable(),c=u.__size;oi(a);const d=i.getPreviousSibling(),f=i.getNextSibling(),g=i.__prev,p=i.__next,v=i.__parent;if(uu(i,!1,!0),d===null?u.__first=s:d.getWritable().__next=s,a.__prev=g,f===null?u.__last=s:f.getWritable().__prev=s,a.__next=p,a.__parent=v,u.__size=c,t&&(oe(this)&&oe(a)||de(139),this.getChildren().forEach(m=>{a.append(m)})),ue(r)){Zt(r);const m=r.anchor,h=r.focus;m.key===o&&Md(m,a),h.key===o&&Md(h,a)}return Mr()===o&&Vt(s),a}insertAfter(e,t=!0){Ht(),hl(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=be();let a=!1,u=!1;if(o!==null){const p=e.getIndexWithinParent();if(oi(i),ue(s)){const v=o.__key,m=s.anchor,h=s.focus;a=m.type==="element"&&m.key===v&&m.offset===p+1,u=h.type==="element"&&h.key===v&&h.offset===p+1}}const c=this.getNextSibling(),d=this.getParentOrThrow().getWritable(),f=i.__key,g=r.__next;if(c===null?d.__last=f:c.getWritable().__prev=f,d.__size++,r.__next=f,i.__next=g,i.__prev=r.__key,i.__parent=r.__parent,t&&ue(s)){const p=this.getIndexWithinParent();da(s,d,p+1);const v=d.__key;a&&s.anchor.set(v,p+2,"element"),u&&s.focus.set(v,p+2,"element")}return e}insertBefore(e,t=!0){Ht(),hl(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;oi(i);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),u=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=o:s.getWritable().__next=o,a.__size++,r.__prev=o,i.__prev=u,i.__next=r.__key,i.__parent=r.__parent;const d=be();return t&&ue(d)&&da(d,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ct()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Ht();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(oe(r))return r.select();if(!Se(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){Ht();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(oe(r))return r.select(0,0);if(!Se(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const cu="historic",Zw="history-push",ri="history-merge",Xw="paste",Qw="collaboration",$w="skip-scroll-into-view",e2="skip-dom-selection",Td="skip-selection-focus";class wi extends $n{static getType(){return"linebreak"}static clone(e){return new wi(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
20
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&va(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&As(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&As(o))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&va(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&As(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&As(o))return!0}return!1})(e)?null:{conversion:t2,priority:0}}}static importJSON(e){return Sr().updateFromJSON(e)}}function t2(n){return{node:Sr()}}function Sr(){return dn(new wi)}function Yi(n){return n instanceof wi}function As(n){return Tr(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ul(n,e){return 16&e?"code":e&Ih?"mark":32&e?"sub":64&e?"sup":null}function cl(n,e){return 1&e?"strong":2&e?"em":"span"}function pv(n,e,t,r,i){const o=r.classList;let s=Zi(i,"base");s!==void 0&&o.add(...s),s=Zi(i,"underlineStrikethrough");let a=!1;const u=8&e&&4&e;s!==void 0&&(8&t&&4&t?(a=!0,u||o.add(...s)):u&&o.remove(...s));for(const c in li){const d=li[c];if(s=Zi(i,c),s!==void 0)if(t&d){if(a&&(c==="underline"||c==="strikethrough")){e&d&&o.remove(...s);continue}((e&d)===0||u&&c==="underline"||c==="strikethrough")&&o.add(...s)}else e&d&&o.remove(...s)}}function mv(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?Ea:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||Br){const[a,u,c]=(function(d,f){const g=d.length,p=f.length;let v=0,m=0;for(;v<g&&v<p&&d[v]===f[v];)v++;for(;m+v<g&&m+v<p&&d[g-m-1]===f[p-m-1];)m++;return[v,g-v-m,f.slice(v,p-m)]})(s,o);u!==0&&r.deleteData(a,u),r.insertData(a,c)}else r.nodeValue=o}}function Ed(n,e,t,r,i,o){mv(i,n,e);const s=o.theme.text;s!==void 0&&pv(0,0,r,n,s)}function Ms(n,e){const t=document.createElement(e);return t.appendChild(n),t}class On extends $n{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new On(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Sw[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=li[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return ga(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=ul(0,r),o=cl(0,r),s=i===null?o:i,a=document.createElement(s);let u=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(u=document.createElement(o),a.appendChild(u)),Ed(u,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,a=ul(0,o),u=ul(0,s),c=cl(0,o),d=cl(0,s);if((a===null?c:a)!==(u===null?d:u))return!0;if(a===u&&c!==d){const m=t.firstChild;m==null&&de(48);const h=document.createElement(d);return Ed(h,this,0,s,i,r),t.replaceChild(h,m),!1}let f=t;u!==null&&a!==null&&(f=t.firstChild,f==null&&de(49)),mv(i,f,this);const g=r.theme.text;g!==void 0&&o!==s&&pv(0,o,s,f,g);const p=e.__style,v=this.__style;return p!==v&&(t.style.cssText=v),!1}static importDOM(){return{"#text":()=>({conversion:o2,priority:0}),b:()=>({conversion:r2,priority:0}),code:()=>({conversion:fr,priority:0}),em:()=>({conversion:fr,priority:0}),i:()=>({conversion:fr,priority:0}),mark:()=>({conversion:fr,priority:0}),s:()=>({conversion:fr,priority:0}),span:()=>({conversion:n2,priority:0}),strong:()=>({conversion:fr,priority:0}),sub:()=>({conversion:fr,priority:0}),sup:()=>({conversion:fr,priority:0}),u:()=>({conversion:fr,priority:0})}}static importJSON(e){return Bt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ft(t)||de(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=Ms(t,"b")),this.hasFormat("italic")&&(t=Ms(t,"i")),this.hasFormat("strikethrough")&&(t=Ms(t,"s")),this.hasFormat("underline")&&(t=Ms(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?li[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?xw[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=ga(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=kw[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){Ht();let r=e,i=t;const o=be(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const u=s.length;r===void 0&&(r=u),i===void 0&&(i=u)}else r=0,i=0;if(!ue(o))return yv(a,r,a,i,"text","text");{const u=Mr();u!==o.anchor.key&&u!==o.focus.key||Vt(a),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,a=r.length;let u=e;u<0&&(u=a+u,u<0&&(u=0));const c=be();if(i&&ue(c)){const f=e+a;c.setTextNodeRange(o,f,o,f)}const d=s.slice(0,u)+r+s.slice(u+t);return o.__text=d,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Ht();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,o=Mr(),s=r.length;e.sort((O,E)=>O-E),e.push(s);const a=[],u=e.length;for(let O=0,E=0;O<s&&E<=u;E++){const D=e[E];D>O&&(a.push(r.slice(O,D)),O=D)}const c=a.length;if(c===1)return[t];const d=a[0],f=t.getParent();let g;const p=t.getFormat(),v=t.getStyle(),m=t.__detail;let h=!1,w=null,b=null;const x=be();if(ue(x)){const[O,E]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];O.type==="text"&&O.key===i&&(w=O),E.type==="text"&&E.key===i&&(b=E)}t.isSegmented()?(g=Bt(d),g.__format=p,g.__style=v,g.__detail=m,g.__state=hd(t,g),h=!0):g=t.setTextContent(d);const S=[g];for(let O=1;O<c;O++){const E=Bt(a[O]);E.__format=p,E.__style=v,E.__detail=m,E.__state=hd(t,E);const D=E.__key;o===i&&Vt(D),S.push(E)}const k=w?w.offset:null,C=b?b.offset:null;let N=0;for(const O of S){if(!w&&!b)break;const E=N+O.getTextContentSize();if(w!==null&&k!==null&&k<=E&&k>=N&&(w.set(O.getKey(),k-N,"text"),k<E&&(w=null)),b!==null&&C!==null&&C<=E&&C>=N){b.set(O.getKey(),C-N,"text");break}N=E}if(f!==null){(function(D){const L=D.getPreviousSibling(),V=D.getNextSibling();L!==null&&ha(L),V!==null&&ha(V)})(this);const O=f.getWritable(),E=this.getIndexWithinParent();h?(O.splice(E,0,S),this.remove()):O.splice(E,1,S),ue(x)&&da(x,f,E,c-1)}return S}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||de(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Mr()===i&&Vt(r);const a=be();if(ue(a)){const f=a.anchor,g=a.focus;f!==null&&f.key===i&&Rd(f,t,r,e,s),g!==null&&g.key===i&&Rd(g,t,r,e,s)}const u=e.__text,c=t?u+o:o+u;this.setTextContent(c);const d=this.getWritable();return e.remove(),d}isTextEntity(){return!1}}function n2(n){return{forChild:tc(n.style),node:null}}function r2(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:tc(e.style,t?void 0:"bold"),node:null}}const Nd=new WeakMap;function i2(n){if(!Ft(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function o2(n){const e=n;n.parentElement===null&&de(129);let t=e.textContent||"";if((function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Nd.get(o))===void 0&&!i2(o);)s.push(o),o=o.parentNode;const a=i===void 0?o:i;for(let u=0;u<s.length;u++)Nd.set(s[u],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const a=r[s];a===`
|
|
21
|
-
`||a===`\r
|
|
22
|
-
`?i.push(Sr()):a===" "?i.push(_o()):a!==""&&i.push(Bt(a))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Ad(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Ad(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:Bt(t)}}function Ad(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,Ft(t)){const o=t.style.display;if(o===""&&!_u(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(Tr(t))return t;if(t.nodeName==="BR")return null}}const s2={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function fr(n){const e=s2[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:tc(n.style,e),node:null}}function Bt(n=""){return dn(new On(n))}function Se(n){return n instanceof On}function tc(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",a=r.includes("underline"),u=n.verticalAlign;return c=>(Se(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),u!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),u!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class mo extends On{static getType(){return"tab"}static clone(e){return new mo(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Zi(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return _o().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Oh(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||de(286),this}setDetail(e){return e!==2&&de(127),this}setMode(e){return e!=="normal"&&de(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function _o(){return dn(new mo)}function La(n){return n instanceof mo}class a2{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Vv(Sn(Cr(this,"next")),Sn(Cr(e,"next")))<0}getNode(){const e=St(this.key);return e===null&&de(20),e}set(e,t,r,i){const o=this._selection,s=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,cs()||(Mr()===s&&Vt(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0)))}}function sr(n,e,t){return new a2(n,e,t)}function dl(n,e){let t=e.__key,r=n.offset,i="element";if(Se(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!oe(e)){const o=e.getNextSibling();if(Se(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Md(n,e){if(oe(e)){const t=e.getLastDescendant();oe(t)||Se(t)?dl(n,t):dl(n,e)}else dl(n,e)}class Ra{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Et(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Ra(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(Se(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=St(i);o!==null&&r.push(o)}return cs()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((be()||bo())===this&&e[0]){const t=Gt(e[0],"next");z2(Ur(t,t))}for(const t of e)t.remove()}}function ue(n){return n instanceof ki}class ki{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!ue(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const i=[],[o,s]=r.getTextSlices();o&&i.push(o.caret.origin);const a=new Set,u=new Set;for(const c of r)if(tr(c)){const{origin:d}=c;i.length===0?a.add(d):(u.add(d),i.push(d))}else{const{origin:d}=c;oe(d)&&u.has(d)||i.push(d)}if(s&&i.push(s.caret.origin),ao(r.focus)&&oe(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=jn(r.focus.origin,"previous");tr(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(i[i.length-1]);c=wc(c))a.delete(c.origin),i.pop();for(;i.length>1;){const c=i[i.length-1];if(!oe(c)||u.has(c)||c.isEmpty()||a.has(c))break;i.pop()}if(i.length===0&&r.isCollapsed()){const c=Sn(r.anchor),d=Sn(r.anchor.getFlipped()),f=p=>Fr(p)?p.origin:p.getNodeAtCaret(),g=f(c)||f(d)||(r.anchor.getNodeAtCaret()?c.origin:d.origin);i.push(g)}return i})(Gv(nf(this),"next"));return cs()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[a,u]=du(this);let c="",d=!0;for(let f=0;f<e.length;f++){const g=e[f];if(oe(g)&&!g.isInline())d||(c+=`
|
|
23
|
-
`),d=!g.isEmpty();else if(d=!1,Se(g)){let p=g.getTextContent();g===t?g===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(p=a<u?p.slice(a,u):p.slice(u,a)):p=s?p.slice(a):p.slice(u):g===r&&(p=s?p.slice(0,u):p.slice(0,a)),c+=p}else!ct(g)&&!Yi(g)||g===r&&this.isCollapsed()||(c+=g.getTextContent())}return c}applyDOMRange(e){const t=mt(),r=t.getEditorState()._selection,i=bv(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(s.key,s.offset,s.type,!0),ro(this)}clone(){const e=this.anchor,t=this.focus;return new ki(sr(e.key,e.offset,e.type),sr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=ga(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=li[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
|
|
24
|
-
`||s===`\r
|
|
25
|
-
`?r.push(Sr()):s===" "?r.push(_o()):r.push(Bt(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,a=t),s.type==="element"&&(function(h,w,b,x){const S=h.getNode(),k=S.getChildAtIndex(h.offset),C=Bt();if(C.setFormat(b),C.setStyle(x),lc(k))k.splice(0,0,[C]);else{const N=zt(S)?Ct().append(C):C;k===null?S.append(N):k.insertBefore(N)}h.is(w)&&w.set(C.__key,0,"text"),h.set(C.__key,0,"text")})(s,a,i,o),a.type==="element"&&vi(a,Sn(Cr(a,"next")));const u=s.offset;let c=a.offset;const d=this.getNodes(),f=d.length;let g=d[0];Se(g)||de(26);const p=g.getTextContent().length,v=g.getParentOrThrow();let m=d[f-1];if(f===1&&a.type==="element"&&(c=p,a.set(s.key,c,"text")),this.isCollapsed()&&u===p&&(vr(g)||!g.canInsertTextAfter()||!v.canInsertTextAfter()&&g.getNextSibling()===null)){let h=g.getNextSibling();if(Se(h)&&h.canInsertTextBefore()&&!vr(h)||(h=Bt(),h.setFormat(i),h.setStyle(o),v.canInsertTextAfter()?g.insertAfter(h):v.insertAfter(h)),h.select(0,0),g=h,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&u===0&&(vr(g)||!g.canInsertTextBefore()||!v.canInsertTextBefore()&&g.getPreviousSibling()===null)){let h=g.getPreviousSibling();if(Se(h)&&!vr(h)||(h=Bt(),h.setFormat(i),v.canInsertTextBefore()?g.insertBefore(h):v.insertBefore(h)),h.select(),g=h,e!=="")return void this.insertText(e)}else if(g.isSegmented()&&u!==p){const h=Bt(g.getTextContent());h.setFormat(i),g.replace(h),g=h}else if(!this.isCollapsed()&&e!==""){const h=m.getParent();if(!v.canInsertTextBefore()||!v.canInsertTextAfter()||oe(h)&&(!h.canInsertTextBefore()||!h.canInsertTextAfter()))return this.insertText(""),_v(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(ii(g)){const x=Bt(e);return x.select(),void g.replace(x)}const h=g.getFormat(),w=g.getStyle();if(u!==c||h===i&&w===o){if(La(g)){const x=Bt(e);return x.setFormat(i),x.setStyle(o),x.select(),void g.replace(x)}}else{if(g.getTextContent()!==""){const x=Bt(e);if(x.setFormat(i),x.setStyle(o),x.select(),u===0)g.insertBefore(x,!1);else{const[S]=g.splitText(u);S.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}g.setFormat(i),g.setStyle(o)}const b=c-u;g=g.spliceText(u,b,e,!0),g.getTextContent()===""?g.remove():this.anchor.type==="text"&&(g.isComposing()?this.anchor.offset-=e.length:(this.format=h,this.style=w))}else{const h=new Set([...g.getParentKeys(),...m.getParentKeys()]),w=oe(g)?g:g.getParentOrThrow();let b=oe(m)?m:m.getParentOrThrow(),x=m;if(!w.is(b)&&b.isInline())do x=b,b=b.getParentOrThrow();while(b.isInline());if(a.type==="text"&&(c!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<c)if(Se(m)&&!ii(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){const O=Bt(m.getTextContent());m.replace(O),m=O}zt(a.getNode())||a.type!=="text"||(m=m.spliceText(0,c,"")),h.add(m.__key)}else{const O=m.getParentOrThrow();O.canBeEmpty()||O.getChildrenSize()!==1?m.remove():O.remove()}else h.add(m.__key);const S=b.getChildren(),k=new Set(d),C=w.is(b),N=w.isInline()&&g.getNextSibling()===null?w:g;for(let O=S.length-1;O>=0;O--){const E=S[O];if(E.is(g)||oe(E)&&E.isParentOf(g))break;E.isAttached()&&(!k.has(E)||E.is(x)?C||N.insertAfter(E,!1):E.remove())}if(!C){let O=b,E=null;for(;O!==null;){const D=O.getChildren(),L=D.length;(L===0||D[L-1].is(E))&&(h.delete(O.__key),E=O),O=O.getParent()}}if(ii(g))if(u===p)g.select();else{const O=Bt(e);O.select(),g.replace(O)}else g=g.spliceText(u,p-u,e,!0),g.getTextContent()===""?g.remove():this.anchor.type==="text"&&(g.isComposing()?this.anchor.offset-=e.length:(this.format=g.getFormat(),this.style=g.getStyle()));for(let O=1;O<f;O++){const E=d[O],D=E.__key;h.has(D)||E.remove()}}}removeText(){const e=be()===this;Vs(this,B2(nf(this))),e&&be()!==this&&Zt(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Vt(null);const r=this.getNodes(),i=[];for(const S of r)Se(S)&&i.push(S);const o=S=>{r.forEach(k=>{if(oe(k)){const C=k.getFormatFlags(e,S);k.setTextFormat(C)}})},s=i.length;if(s===0)return this.toggleFormat(e),Vt(null),void o(t);const a=this.anchor,u=this.focus,c=this.isBackward(),d=c?u:a,f=c?a:u;let g=0,p=i[0],v=d.type==="element"?0:d.offset;if(d.type==="text"&&v===p.getTextContentSize()&&(g=1,p=i[1],v=0),p==null)return;const m=p.getFormatFlags(e,t);o(m);const h=s-1;let w=i[h];const b=f.type==="text"?f.offset:w.getTextContentSize();if(p.is(w)){if(v===b)return;if(vr(p)||v===0&&b===p.getTextContentSize())p.setFormat(m);else{const S=p.splitText(v,b),k=v===0?S[0]:S[1];k.setFormat(m),d.type==="text"&&d.set(k.__key,0,"text"),f.type==="text"&&f.set(k.__key,b-v,"text")}return void(this.format=m)}v===0||vr(p)||([,p]=p.splitText(v),v=0),p.setFormat(m);const x=w.getFormatFlags(e,m);b>0&&(b===w.getTextContentSize()||vr(w)||([w]=w.splitText(b)),w.setFormat(x));for(let S=g+1;S<h;S++){const k=i[S],C=k.getFormatFlags(e,x);k.setFormat(C)}d.type==="text"&&d.set(p.__key,v,"text"),f.type==="text"&&f.set(w.__key,b,"text"),this.format=m|x}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const v=be();return ue(v)||de(134),v.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=rn(t,wn),i=e[e.length-1];if(oe(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const v=fl(this);r.splice(v,0,e),i.selectEnd()}return}if(!e.some(v=>(oe(v)||ct(v))&&!v.isInline())){oe(r)||de(211,t.constructor.name,t.getType());const v=fl(this);return r.splice(v,0,e),void i.selectEnd()}const o=(function(v){const m=Ct();let h=null;for(let w=0;w<v.length;w++){const b=v[w],x=Yi(b);if(x||ct(b)&&b.isInline()||oe(b)&&b.isInline()||Se(b)||b.isParentRequired()){if(h===null&&(h=b.createParentElementNode(),m.append(h),x))continue;h!==null&&h.append(b)}else m.append(b),h=null}return m})(e),s=o.getLastDescendant(),a=o.getChildren(),u=!oe(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let d=a[0];var f;oe(f=d)&&wn(f)&&!f.isEmpty()&&oe(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(oe(r)||de(211,t.constructor.name,t.getType()),r.append(...d.getChildren()),d=a[1]),d&&(r===null&&de(212,t.constructor.name,t.getType()),(function(v,m){const h=m.getParentOrThrow().getLastChild();let w=m;const b=[m];for(;w!==h;)w.getNextSibling()||de(140),w=w.getNextSibling(),b.push(w);let x=v;for(const S of b)x=x.insertAfter(S)})(r,d));const g=rn(s,wn);u&&oe(g)&&(u.canMergeWhenEmpty()||wn(c))&&(g.append(...u.getChildren()),u.remove()),oe(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const p=oe(r)?r.getLastChild():null;Yi(p)&&g!==r&&p.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ct();return Pt().splice(this.anchor.offset,0,[s]),s.select(),s}const e=fl(this),t=rn(this.anchor.getNode(),wn);oe(t)||de(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=Sr();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[o,s]=du(this),a=this.isBackward(),[u,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[d,f]=a?[s,o]:[o,s];if(t===0)return[];if(t===1){if(Se(r)&&!this.isCollapsed()){const g=r.splitText(d,f),p=d===0?g[0]:g[1];return p?(u.set(p.getKey(),0,"text"),c.set(p.getKey(),p.getTextContentSize(),"text"),[p]):[]}return[r]}if(Se(r)&&(d===r.getTextContentSize()?e.shift():d!==0&&([,r]=r.splitText(d),e[0]=r,u.set(r.getKey(),0,"text"))),Se(i)){const g=i.getTextContent().length;f===0?e.pop():f!==g&&([i]=i.splitText(f),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(zd(this,e,t,r))return;const i=e==="move",o=mt(),s=Hn(Dn(o));if(!s)return;const a=o._blockCursorElement,u=o._rootElement,c=this.focus.getNode();if(u===null||a===null||!oe(c)||c.isInline()||c.canBeEmpty()||pu(a,o,u),this.dirty){let d=di(o,this.anchor.key),f=di(o,this.focus.key);this.anchor.type==="text"&&(d=oo(d)),this.focus.type==="text"&&(f=oo(f)),d&&f&&xv(s,d,this.anchor.offset,f,this.focus.offset)}if((function(d,f,g,p){d.modify(f,g,p)})(s,e,t?"backward":"forward",r),s.rangeCount>0){const d=s.getRangeAt(0),f=this.anchor.getNode(),g=zt(f)?f:k2(f);if(this.applyDOMRange(d),this.dirty=!0,!i){const p=this.getNodes(),v=[];let m=!1;for(let h=0;h<p.length;h++){const w=p[h];vu(w,g)?v.push(w):m=!0}if(m&&v.length>0)if(t){const h=v[0];oe(h)?h.selectStart():h.getParentOrThrow().selectStart()}else{const h=v[v.length-1];oe(h)?h.selectEnd():h.getParentOrThrow().selectEnd()}s.anchorNode===d.startContainer&&s.anchorOffset===d.startOffset||(function(h){const w=h.focus,b=h.anchor,x=b.key,S=b.offset,k=b.type;b.set(w.key,w.offset,w.type,!0),w.set(x,S,k,!0)})(this)}}r==="lineboundary"&&zd(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&oe(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(oe(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=Sc(Cr(r,e?"previous":"next"));if(o.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const u of o.iterNodeCarets("shadowRoot"))if(tr(u)){if(!u.origin.isInline()){if(u.origin.isShadowRoot()){if(a.type==="merge-block")break;if(oe(o.anchor.origin)&&o.anchor.origin.isEmpty()){const c=Sn(u);Vs(this,Ur(c,c)),o.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:u,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(ao(u)){if(oe(u.origin)){if(u.origin.isInline()){if(!u.origin.isParentOf(o.anchor.origin))break}else a={block:u.origin,type:"merge-next-block"};continue}if(ct(u.origin)){if(!u.origin.isIsolated())if(a.type==="merge-next-block"&&(u.origin.isKeyboardSelectable()||!u.origin.isInline())&&oe(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const c=rc();c.add(u.origin.getKey()),Zt(c)}else u.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:u,block:c}=a;return Vs(this,Ur(!u.origin.isEmpty()&&c.isEmpty()?Cc(Gt(c,u.direction)):o.anchor,u)),this.removeText()}}const s=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Od(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const u=s.offset,c=a.getTextContentSize();if(a.is(i)||e&&u!==c||!e&&u!==0)return void Dd(a,e,u)}else if(i!==null&&i.isSegmented()){const u=r.offset,c=i.getTextContentSize();if(i.is(a)||e&&u!==0||!e&&u!==c)return void Dd(i,e,u)}(function(u,c){const d=u.anchor,f=u.focus,g=d.getNode(),p=f.getNode();if(g===p&&d.type==="text"&&f.type==="text"){const v=d.offset,m=f.offset,h=v<m,w=h?v:m,b=h?m:v,x=b-1;w!==x&&(function(S){return!(Rv(S)||l2(S))})(g.getTextContent().slice(w,b))&&(c?f.set(f.key,x,f.type):d.set(d.key,x,d.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&zt(r.getParent())&&r.getPreviousSibling()===null&&Od(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Et(n){return n instanceof Ra}function Pd(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function du(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Pd(t),Pd(r)]}function Od(n,e){for(let t=e;t;t=t.getParent()){if(oe(t)){if(t.collapseAtStart(n))return!0;if(un(t))break}if(t.getPreviousSibling())break}return!1}const l2=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Dd(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,a=0;for(let c=0;c<o;c++){const d=c===o-1;if(a=s,s+=i[c].length,e&&s===t||s>t||d){i.splice(c,1),d&&(a=void 0);break}}const u=i.join("").trim();u===""?r.remove():(r.setTextContent(u),r.select(a,a))}function Id(n,e,t,r){let i,o=e;if(Ft(n)){let s=!1;const a=n.childNodes,u=a.length,c=r._blockCursorElement;o===u&&(s=!0,o=u-1);let d=a[o],f=!1;if(d===c)d=a[o+1],f=!0;else if(c!==null){const g=c.parentNode;n===g&&e>Array.prototype.indexOf.call(g.children,c)&&o--}if(i=Ui(d),Se(i))o=Lr(i,s?"next":"previous");else{let g=Ui(n);if(g===null)return null;if(oe(g)){const p=r.getElementByKey(g.getKey());p===null&&de(214),[g,o]=g.getDOMSlot(p).resolveChildIndex(g,p,n,e),oe(g)||de(215),s&&o>=g.getChildrenSize()&&(o=Math.max(0,g.getChildrenSize()-1));let m=g.getChildAtIndex(o);if(oe(m)&&(function(h,w,b){const x=h.getParent();return b===null||x===null||!x.canBeEmpty()||x!==b.getNode()})(m,0,t)){const h=s?m.getLastDescendant():m.getFirstDescendant();h===null?g=m:(m=h,g=oe(m)?m:m.getParentOrThrow()),o=0}Se(m)?(i=m,g=null,o=Lr(m,s?"next":"previous")):m!==g&&s&&!f&&(oe(g)||de(216),o=Math.min(g.getChildrenSize(),o+1))}else{const p=g.getIndexWithinParent();o=e===0&&ct(g)&&Ui(n)===g?p:p+1,g=g.getParentOrThrow()}if(oe(g))return sr(g.__key,o,"element")}}else i=Ui(n);return Se(i)?sr(i.__key,Lr(i,o,"clamp"),"text"):null}function Fd(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&oe(s)&&s.isInline()){const a=s.getPreviousSibling();Se(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else oe(o)&&!t&&o.isInline()?n.set(o.__key,o.getChildrenSize(),"element"):Se(o)&&n.set(o.__key,o.getTextContent().length,"text")}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&oe(o)&&o.isInline())n.set(o.__key,0,"element");else if((t||e)&&o===null&&oe(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();Se(a)&&n.set(a.__key,0,"text")}}}function _v(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Fd(n,r,i),Fd(e,!r,i),i&&e.set(n.key,n.offset,n.type);const o=mt();if(o.isComposing()&&o._compositionKey!==n.key&&ue(t)){const s=t.anchor,a=t.focus;n.set(s.key,s.offset,s.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function bv(n,e,t,r,i,o){if(n===null||t===null||!fs(i,n,t))return null;const s=Id(n,e,ue(o)?o.anchor:null,i);if(s===null)return null;const a=Id(t,r,ue(o)?o.focus:null,i);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const u=Ui(n),c=Ui(t);if(ct(u)&&ct(c))return null}return _v(s,a,o),[s,a]}function fu(n){return oe(n)&&!n.isInline()}function yv(n,e,t,r,i,o){const s=Kr(),a=new ki(sr(n,e,i),sr(t,r,o),0,"");return a.dirty=!0,s._selection=a,a}function nc(){const n=sr("root",0,"element"),e=sr("root",0,"element");return new ki(n,e,0,"")}function rc(){return new Ra(new Set)}function ic(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,a=s==="selectionchange",u=!ql&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,d,f,g;if(ue(n)&&!u)return n.clone();if(e===null)return null;if(c=e.anchorNode,d=e.focusNode,f=e.anchorOffset,g=e.focusOffset,(a||s===void 0)&&ue(n)&&!fs(t,c,d))return n.clone();const p=bv(c,f,d,g,t,n);if(p===null)return null;const[v,m]=p;return new ki(v,m,ue(n)?n.format:0,ue(n)?n.style:"")}function be(){return Kr()._selection}function bo(){return mt()._editorState._selection}function da(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),a=o.getNode();if(!e.is(s)&&!e.is(a))return;const u=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const d=Math.max(0,c+r);i.set(u,d,"element"),o.set(u,d,"element"),Ld(n)}}else{const c=n.isBackward(),d=c?o:i,f=d.getNode(),g=c?i:o,p=g.getNode();if(e.is(f)){const v=d.offset;(t<=v&&r>0||t<v&&r<0)&&d.set(u,Math.max(0,v+r),"element")}if(e.is(p)){const v=g.offset;(t<=v&&r>0||t<v&&r<0)&&g.set(u,Math.max(0,v+r),"element")}}Ld(n)}function Ld(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!oe(o))return;const a=o.getChildrenSize(),u=t>=a,c=u?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(Se(c)){let d=0;u&&(d=c.getTextContentSize()),e.set(c.__key,d,"text"),r.set(c.__key,d,"text")}return}if(oe(o)){const a=o.getChildrenSize(),u=t>=a,c=u?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(Se(c)){let d=0;u&&(d=c.getTextContentSize()),e.set(c.__key,d,"text")}}if(oe(s)){const a=s.getChildrenSize(),u=i>=a,c=u?s.getChildAtIndex(a-1):s.getChildAtIndex(i);if(Se(c)){let d=0;u&&(d=c.getTextContentSize()),r.set(c.__key,d,"text")}}}function fa(n,e,t,r,i){let o=null,s=0,a=null;r!==null?(o=r.__key,Se(r)?(s=r.getTextContentSize(),a="text"):oe(r)&&(s=r.getChildrenSize(),a="element")):i!==null&&(o=i.__key,Se(i)?a="text":oe(i)&&(a="element")),o!==null&&a!==null?n.set(o,s,a):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function Rd(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function xv(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function u2(n,e,t,r,i,o,s){const a=r.anchorNode,u=r.focusNode,c=r.anchorOffset,d=r.focusOffset,f=document.activeElement;if(i.has(Qw)&&f!==o||f!==null&&fc(f))return;if(!ue(e))return void(n!==null&&fs(t,a,u)&&r.removeAllRanges());const g=e.anchor,p=e.focus,v=g.key,m=p.key,h=di(t,v),w=di(t,m),b=g.offset,x=p.offset,S=e.format,k=e.style,C=e.isCollapsed();let N=h,O=w,E=!1;if(g.type==="text"){N=oo(h);const M=g.getNode();E=M.getFormat()!==S||M.getStyle()!==k}else ue(n)&&n.anchor.type==="text"&&(E=!0);var D,L,V,G,U;if(p.type==="text"&&(O=oo(w)),N!==null&&O!==null&&(C&&(n===null||E||ue(n)&&(n.format!==S||n.style!==k))&&(D=S,L=k,V=b,G=v,U=performance.now(),uv=[D,L,V,G,U]),c!==b||d!==x||a!==N||u!==O||r.type==="Range"&&C||(f!==null&&o.contains(f)||i.has(Td)||o.focus({preventScroll:!0}),g.type==="element"))){if(xv(r,N,b,O,x),!Br||!e.isCollapsed()||o===null||i.has(Td)||document.activeElement!==null&&o.contains(document.activeElement)||o.focus({preventScroll:!0}),!i.has($w)&&e.isCollapsed()&&o!==null&&o===document.activeElement){const M=ue(e)&&e.anchor.type==="element"?N.childNodes[b]||null:r.rangeCount>0?r.getRangeAt(0):null;if(M!==null){let j;if(M instanceof Text){const Y=document.createRange();Y.selectNode(M),j=Y.getBoundingClientRect()}else j=M.getBoundingClientRect();(function(Y,Z,W){const H=jv(W),ie=_c(H);if(H===null||ie===null)return;let{top:I,bottom:F}=Z,R=0,B=0,re=W;for(;re!==null;){const le=re===H.body;if(le)R=0,B=Dn(Y).innerHeight;else{const Ae=re.getBoundingClientRect();R=Ae.top,B=Ae.bottom}let ke=0;if(I<R?ke=-(R-I):F>B&&(ke=F-B),ke!==0)if(le)ie.scrollBy(0,ke);else{const Ae=re.scrollTop;re.scrollTop+=ke;const we=re.scrollTop-Ae;I-=we,F-=we}if(le)break;re=gs(re)}})(t,j,o)}}ou=!0}}function Ri(n){let e=be()||bo();e===null&&(e=Pt().selectEnd()),e.insertNodes(n)}function fl(n){let e=n;n.isCollapsed()||e.removeText();const t=be();ue(t)&&(e=t),ue(e)||de(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!wn(i);){const s=i;if([i,o]=c2(i,o),s.is(i))break}return o}function c2(n,e){const t=n.getParent();if(!t){const i=Ct();return Pt().append(i),i.select(),[Pt(),0]}if(Se(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!oe(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new ki(sr(n.__key,e,"element"),sr(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function zd(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[d,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(d.key,d.offset,d.type),!0}const o=Cr(n.focus,t?"previous":"next"),s=r==="lineboundary",a=e==="move";let u=o,c=i==="decorators-and-blocks";if(!qv(u)){for(const d of u){c=!1;const{origin:f}=d;if(!ct(f)||f.isIsolated()||(u=d,!s||!f.isInline()))break}if(c)for(const d of Sc(o).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(tr(d))d.origin.isInline()||(u=d);else{if(oe(d.origin))continue;ct(d.origin)&&!d.origin.isInline()&&(u=d)}break}}if(u===o)return!1;if(a&&!s&&ct(u.origin)&&u.origin.isKeyboardSelectable()){const d=rc();return d.add(u.origin.getKey()),Zt(d),!0}return u=Sn(u),a&&vi(n.anchor,u),vi(n.focus,u),c||!s}let Ut=null,jt=null,ln=!1,gl=!1,Ks=0;const Bd={characterData:!0,childList:!0,subtree:!0};function cs(){return ln||Ut!==null&&Ut._readOnly}function Ht(){ln&&de(13)}function wv(){Ks>99&&de(14)}function Kr(){return Ut===null&&de(195,kv()),Ut}function mt(){return jt===null&&de(196,kv()),jt}function kv(){let n=0;const e=new Set,t=io.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=Ba(i);if(gc(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function d2(){return jt}function Ud(n,e,t){const r=e.__type,i=Av(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let a=0;a<s&&(o[a](e),e.isAttached());a++);}function jd(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Sv(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function f2(n){return oc(n,mt()._nodes)}function oc(n,e){const t=n.type,r=e.get(t);r===void 0&&de(17,t);const i=r.klass;n.type!==i.getType()&&de(18,i.name);const o=i.importJSON(n),s=n.children;if(oe(o)&&Array.isArray(s))for(let a=0;a<s.length;a++){const u=oc(s[a],e);o.append(u)}return o}function Wd(n,e,t){const r=Ut,i=ln,o=jt;Ut=e,ln=!0,jt=n;try{return t()}finally{Ut=r,ln=i,jt=o}}function mr(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,a=t._selection,u=n._dirtyType!==0,c=Ut,d=ln,f=jt,g=n._updating,p=n._observer;let v=null;if(n._pendingEditorState=null,n._editorState=t,!i&&u&&p!==null){jt=n,Ut=t,ln=!1,n._updating=!0;try{const C=n._dirtyType,N=n._dirtyElements,O=n._dirtyLeaves;p.disconnect(),v=Ow(o,t,n,C,N,O)}catch(C){if(C instanceof Error&&n._onError(C),gl)throw C;return Nv(n,null,r,t),zh(n),n._dirtyType=2,gl=!0,mr(n,o),void(gl=!1)}finally{p.observe(r,Bd),n._updating=g,Ut=c,ln=d,jt=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,h=n._dirtyElements,w=n._normalizedNodes,b=n._updateTags,x=n._deferred;u&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(C,N){const O=C._decorators;let E=C._pendingDecorators||O;const D=N._nodeMap;let L;for(L in E)D.has(L)||(E===O&&(E=Fv(C)),delete E[L])})(n,t);const S=i?null:Hn(Dn(n));if(n._editable&&S!==null&&(u||a===null||a.dirty||!a.is(s))&&r!==null&&!b.has(e2)){jt=n,Ut=t;try{if(p!==null&&p.disconnect(),u||a===null||a.dirty){const C=n._blockCursorElement;C!==null&&pu(C,n,r),u2(s,a,n,S,b,r)}(function(C,N,O){let E=C._blockCursorElement;if(ue(O)&&O.isCollapsed()&&O.anchor.type==="element"&&N.contains(document.activeElement)){const D=O.anchor,L=D.getNode(),V=D.offset;let G=!1,U=null;if(V===L.getChildrenSize())vl(L.getChildAtIndex(V-1))&&(G=!0);else{const M=L.getChildAtIndex(V);if(M!==null&&vl(M)){const j=M.getPreviousSibling();(j===null||vl(j))&&(G=!0,U=C.getElementByKey(M.__key))}}if(G){const M=C.getElementByKey(L.__key);return E===null&&(C._blockCursorElement=E=(function(j){const Y=j.theme,Z=document.createElement("div");Z.contentEditable="false",Z.setAttribute("data-lexical-cursor","true");let W=Y.blockCursor;if(W!==void 0){if(typeof W=="string"){const H=jr(W);W=Y.blockCursor=H}W!==void 0&&Z.classList.add(...W)}return Z})(C._config)),N.style.caretColor="transparent",void(U===null?M.appendChild(E):M.insertBefore(E,U))}}E!==null&&pu(E,C,N)})(n,r,a)}finally{p!==null&&p.observe(r,Bd),jt=f,Ut=c}}v!==null&&(function(C,N,O,E,D){const L=Array.from(C._listeners.mutation),V=L.length;for(let G=0;G<V;G++){const[U,M]=L[G];for(const j of M){const Y=N.get(j);Y!==void 0&&U(Y,{dirtyLeaves:E,prevEditorState:D,updateTags:O})}}})(n,v,b,m,o),ue(a)||a===null||s!==null&&s.is(a)||n.dispatchCommand(Ma,void 0);const k=n._pendingDecorators;k!==null&&(n._decorators=k,n._pendingDecorators=null,Lo("decorator",n,!0,k)),(function(C,N,O){const E=Jd(N),D=Jd(O);E!==D&&Lo("textcontent",C,!0,D)})(n,e||o,t),Lo("update",n,!0,{dirtyElements:h,dirtyLeaves:m,editorState:t,mutatedNodes:v,normalizedNodes:w,prevEditorState:e||o,tags:b}),(function(C,N){if(C._deferred=[],N.length!==0){const O=C._updating;C._updating=!0;try{for(let E=0;E<N.length;E++)N[E]()}finally{C._updating=O}}})(n,x),(function(C){const N=C._updates;if(N.length!==0){const O=N.shift();if(O){const[E,D]=O;za(C,E,D)}}})(n)}function Lo(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function Kd(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i,a=n._pendingEditorState;let u;s!==void 0&&(u=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&de(191),a._flushSync=!0),u&&n._deferred.push(u),Sv(n,s.tag)),a==null?za(n,o,s):o()}}return r}function za(n,e,t){const r=n._updateTags;let i,o=!1,s=!1;t!==void 0&&(i=t.onUpdate,Sv(n,t.tag),o=t.skipTransforms||!1,s=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let u=n._pendingEditorState,c=!1;(u===null||u._readOnly)&&(u=n._pendingEditorState=Cv(u||a),c=!0),u._flushSync=s;const d=Ut,f=ln,g=jt,p=n._updating;Ut=u,ln=!1,n._updating=!0,jt=n;const v=n._headless||n.getRootElement()===null;cc(null);try{c&&(v?a._selection!==null&&(u._selection=a._selection.clone()):u._selection=(function(b,x){const S=b.getEditorState()._selection,k=Hn(Dn(b));return ue(S)||S==null?ic(S,k,b,x):S.clone()})(n,t&&t.event||null));const h=n._compositionKey;e(),o=Kd(n,o),(function(b,x){const S=x.getEditorState()._selection,k=b._selection;if(ue(k)){const C=k.anchor,N=k.focus;let O;if(C.type==="text"&&(O=C.getNode(),O.selectionTransform(S,k)),N.type==="text"){const E=N.getNode();O!==E&&E.selectionTransform(S,k)}}})(u,n),n._dirtyType!==0&&(o?(function(b,x){const S=x._dirtyLeaves,k=b._nodeMap;for(const C of S){const N=k.get(C);Se(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&md(N)}})(u,n):(function(b,x){const S=x._dirtyLeaves,k=x._dirtyElements,C=b._nodeMap,N=Mr(),O=new Map;let E=S,D=E.size,L=k,V=L.size;for(;D>0||V>0;){if(D>0){x._dirtyLeaves=new Set;for(const G of E){const U=C.get(G);Se(U)&&U.isAttached()&&U.isSimpleText()&&!U.isUnmergeable()&&md(U),U!==void 0&&jd(U,N)&&Ud(x,U,O),S.add(G)}if(E=x._dirtyLeaves,D=E.size,D>0){Ks++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,L.delete("root")&&L.set("root",!0);for(const G of L){const U=G[0],M=G[1];if(k.set(U,M),!M)continue;const j=C.get(U);j!==void 0&&jd(j,N)&&Ud(x,j,O)}E=x._dirtyLeaves,D=E.size,L=x._dirtyElements,V=L.size,Ks++}x._dirtyLeaves=S,x._dirtyElements=k})(u,n),Kd(n),(function(b,x,S,k){const C=b._nodeMap,N=x._nodeMap,O=[];for(const[E]of k){const D=N.get(E);D!==void 0&&(D.isAttached()||(oe(D)&&Fh(D,E,C,N,O,k),C.has(E)||k.delete(E),O.push(E)))}for(const E of O)N.delete(E);for(const E of S){const D=N.get(E);D===void 0||D.isAttached()||(C.has(E)||S.delete(E),N.delete(E))}})(a,u,n._dirtyLeaves,n._dirtyElements)),h!==n._compositionKey&&(u._flushSync=!0);const w=u._selection;if(ue(w)){const b=u._nodeMap,x=w.anchor.key,S=w.focus.key;b.get(x)!==void 0&&b.get(S)!==void 0||de(19)}else Et(w)&&w._nodes.size===0&&(u._selection=null)}catch(h){return h instanceof Error&&n._onError(h),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void mr(n)}finally{Ut=d,ln=f,jt=g,n._updating=p,Ks=0}n._dirtyType!==0||n._deferred.length>0||(function(h,w){const b=w.getEditorState()._selection,x=h._selection;if(x!==null){if(x.dirty||!x.is(b))return!0}else if(b!==null)return!0;return!1})(u,n)?u._flushSync?(u._flushSync=!1,mr(n)):c&&m2(()=>{mr(n)}):(u._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function er(n,e,t){jt===n&&t===void 0?e():za(n,e,t)}class Ro{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new Ro(this.element,e,this.after)}withAfter(e){return new Ro(this.element,this.before,e)}withElement(e){return this.element===e?this:new Ro(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&de(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&de(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&de(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(us||po||ls);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,o=document.createElement("br");if(r.insertBefore(o,i),e){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,o),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const u=this.getFirstChildOffset();return[e,Math.min(u+e.getChildrenSize(),Math.max(u,i))]}const o=Hd(t,r);o.push(i);const s=Hd(t,this.element);let a=e.getIndexWithinParent();for(let u=0;u<s.length;u++){const c=o[u],d=s[u];if(c===void 0||c<d)break;if(c>d){a+=1;break}}return[e.getParentOrThrow(),a]}}function Hd(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)i++;t.push(i)}return r!==n&&de(225),t.reverse()}class yn extends $n{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return ww[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=mt()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(Se(t)&&e.push(t),oe(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;oe(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;oe(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return oe(o)&&o.getLastDescendant()||o||null}const i=t[e];return oe(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:St(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&de(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:St(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&de(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),oe(o)&&i!==r-1&&!o.isInline()&&(e+=Na)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),oe(o)&&i!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=ud[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=li[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return ga(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Ht();const r=be();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const u=this.getFirstChild();if(Se(u)||oe(u))return u.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const u=this.getLastChild();if(Se(u)||oe(u))return u.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const a=this.__key;return ue(r)?(r.anchor.set(a,i,"element"),r.focus.set(a,o,"element"),r.dirty=!0,r):yv(a,i,a,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?ud[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){ca(this)&&de(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();e+t<=i||de(226,String(e),String(t),String(i));const s=o.__key,a=[],u=[],c=this.getChildAtIndex(e+t);let d=null,f=i-t+r.length;if(e!==0)if(e===i)d=this.getLastChild();else{const p=this.getChildAtIndex(e);p!==null&&(d=p.getPreviousSibling())}if(t>0){let p=d===null?this.getFirstChild():d.getNextSibling();for(let v=0;v<t;v++){p===null&&de(100);const m=p.getNextSibling(),h=p.__key;oi(p.getWritable()),u.push(h),p=m}}let g=d;for(const p of r){g!==null&&p.is(g)&&(d=g=g.getPreviousSibling());const v=p.getWritable();v.__parent===s&&f--,oi(v);const m=p.__key;if(g===null)o.__first=m,v.__prev=null;else{const h=g.getWritable();h.__next=m,v.__prev=h.__key}p.__key===s&&de(76),v.__parent=s,a.push(m),g=p}if(e+t===i)g!==null&&(g.getWritable().__next=null,o.__last=g.__key);else if(c!==null){const p=c.getWritable();if(g!==null){const v=g.getWritable();p.__prev=g.__key,v.__next=c.__key}else p.__prev=null}if(o.__size=f,u.length){const p=be();if(ue(p)){const v=new Set(u),m=new Set(a),{anchor:h,focus:w}=p;Vd(h,v,m)&&fa(h,h.getNode(),this,d,c),Vd(w,v,m)&&fa(w,w.getNode(),this,d,c),f!==0||this.canBeEmpty()||un(this)||this.remove()}}return o}getDOMSlot(e){return new Ro(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||un(this)||this.getChildren().some(Se)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const s=t.getElementByKey(o.getKey());s!==null&&(i==null?(r.insertChild(s),i=s):i!==s&&r.replaceChild(s,i),i=i.nextSibling)}}}function oe(n){return n instanceof yn}function Vd(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class Si extends $n{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ct(n){return n instanceof Si}class Ci extends yn{__cachedText;static getType(){return"root"}static clone(){return new Ci}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){de(51)}getTextContent(){const e=this.__cachedText;return!cs()&&mt()._dirtyType!==0||e===null?super.getTextContent():e}remove(){de(52)}replace(e){de(53)}insertBefore(e){de(54)}insertAfter(e){de(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)oe(i)||ct(i)||de(282);return super.splice(e,t,r)}static importJSON(e){return Pt().updateFromJSON(e)}collapseAtStart(){return!0}}function zt(n){return n instanceof Ci}function Cv(n){return new ds(new Map(n._nodeMap))}function sc(){return new ds(new Map([["root",new Ci]]))}function Tv(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&de(130,t.name),oe(n)){const r=e.children;Array.isArray(r)||de(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=Tv(i[o]);r.push(s)}}return e}function g2(n){return n instanceof ds}class ds{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Wd(t&&t.editor||null,this,e)}clone(e){const t=new ds(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Wd(null,this,()=>({root:Tv(Pt())}))}}class ac extends yn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Ti extends yn{static getType(){return"paragraph"}static clone(e){return new Ti(e.__key)}createDOM(e){const t=document.createElement("p"),r=Zi(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:h2,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return Ct().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(Se);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=Ct();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||Se(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function h2(n){const e=Ct();return n.style&&(e.setFormat(n.style.textAlign),bc(n,e)),{node:e}}function Ct(){return dn(new Ti)}function lc(n){return n instanceof Ti}const Xe=0,nn=1,Ev=4;function Nv(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=sc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function v2(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=Wa(r),o=r.transform;if(!t.has(o)){t.add(o);const s=r.transform();s&&e.add(s)}if(i){const s=i.$transform;s&&e.add(s),r=i.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof $n&&s!==$n?s:void 0}}return e}function uc(n){const e=n||{},t=d2(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=sc(),a=e.namespace||(i!==null?i._config.namespace:zv()),u=e.editorState,c=[Ci,On,wi,mo,Ti,ac,...e.nodes||[]],{onError:d,html:f}=e,g=e.editable===void 0||e.editable;let p;if(n===void 0&&t!==null)p=t._nodes;else{p=new Map;for(let m=0;m<c.length;m++){let h=c[m],w=null,b=null;if(typeof h!="function"){const k=h;h=k.replace,w=k.with,b=k.withKlass||null}Wa(h);const x=h.getType(),S=v2(h);p.set(x,{exportDOM:f&&f.export?f.export.get(h):void 0,klass:h,replace:w,replaceWithKlass:b,sharedNodeState:Bh(c[m]),transforms:S})}}const v=new io(s,i,p,{disableEvents:o,namespace:a,theme:r},d||console.error,(function(m,h){const w=new Map,b=new Set,x=S=>{Object.keys(S).forEach(k=>{let C=w.get(k);C===void 0&&(C=[],w.set(k,C)),C.push(S[k])})};return m.forEach(S=>{const k=S.klass.importDOM;if(k==null||b.has(k))return;b.add(k);const C=k.call(S.klass);C!==null&&x(C)}),h&&x(h),w})(p,f?f.import:void 0),g,n);return u!==void 0&&(v._pendingEditorState=u,v._dirtyType=2),(function(m){m.registerCommand(Vh,Hw,Xe),m.registerCommand(Jh,Vw,Xe),m.registerCommand(qh,Jw,Xe),m.registerCommand(Gh,qw,Xe),m.registerCommand(Yh,Gw,Xe)})(v),v}class io{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,o,s,a,u){this._createEditorArgs=u,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=zv(),this._onError=o,this._htmlConversions=s,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&de(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&de(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;let s=o.get(t);s===void 0&&(s=new Set,o.set(t,s)),s.add(i);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,i),()=>{s.delete(i),s.size===0&&o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&de(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=$d(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const s=this.registerNodeTransformToKlass(o,t);i.push(s)}return(function(s,a){const u=$d(s.getEditorState()),c=[];for(const d of a){const f=u.get(d);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const d of c)for(const f of d.keys()){const g=St(f);g&&g.markDirty()}},s._pendingEditorState===null?{tag:ri}:void 0)})(this,i.map(s=>s.klass.getType())),()=>{i.forEach(s=>s.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Ne(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=Zi(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,Nv(this,t,e,i),t!==null&&(this._config.disableEvents||Yw(t),r!=null&&t.classList.remove(...r)),e!==null){const o=_c(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=2,zh(this),this._updateTags.add(ri),mr(this),this._config.disableEvents||(function(a,u){const c=a.ownerDocument;iu.set(a,c);const d=la.get(c)??0;d<1&&c.addEventListener("selectionchange",hv),la.set(c,d+1),a.__lexicalEditor=u;const f=gv(a);for(let g=0;g<ru.length;g++){const[p,v]=ru[g],m=typeof v=="function"?h=>{Cd(h)||(Sd(h),(u.isEditable()||p==="click")&&v(h,u))}:h=>{if(Cd(h))return;Sd(h);const w=u.isEditable();switch(p){case"cut":return w&&Ne(u,ec,h);case"copy":return Ne(u,Fa,h);case"paste":return w&&Ne(u,Oa,h);case"dragstart":return w&&Ne(u,$u,h);case"dragover":return w&&Ne(u,sv,h);case"dragend":return w&&Ne(u,zw,h);case"focus":return w&&Ne(u,jw,h);case"blur":return w&&Ne(u,Ww,h);case"drop":return w&&Ne(u,iv,h)}};a.addEventListener(p,m),f.push(()=>{a.removeEventListener(p,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(ri),mr(this);Lo("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&de(38);let r=e;r._readOnly&&(r=Cv(e),r._selection=e._selection?e._selection.clone():null),Rh(this);const i=this._pendingEditorState,o=this._updateTags,s=t!==void 0?t.tag:null;i===null||i.isEmpty()||(s!=null&&o.add(s),mr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&o.add(s),this._updating||mr(this)}parseEditorState(e,t){return(function(r,i,o){const s=sc(),a=Ut,u=ln,c=jt,d=i._dirtyElements,f=i._dirtyLeaves,g=i._cloneNotNeeded,p=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,Ut=s,ln=!1,jt=i,cc(null);try{const v=i._nodes;oc(r.root,v),o&&o(),s._readOnly=!0}catch(v){v instanceof Error&&i._onError(v)}finally{i._dirtyElements=d,i._dirtyLeaves=f,i._cloneNotNeeded=g,i._dirtyType=p,Ut=a,ln=u,jt=c}return s})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return mr(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,o){r._updating?r._updates.push([i,o]):za(r,i,o)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),er(this,()=>{const i=be(),o=Pt();i!==null?i.dirty||Zt(i.clone()):o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd()),x2("focus"),w2(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Hn(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Lo("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}io.version="0.40.0+prod.esm";let gu=null;function cc(n){gu=n}let p2=1;function Av(n,e){const t=dc(n,e);return t===void 0&&de(30,e),t}function dc(n,e){return n._nodes.get(e)}const m2=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Mv(n){return ct(so(n))}function fc(n){const e=document.activeElement;if(!Ft(e))return!1;const t=e.nodeName;return ct(so(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Ba(e)==null)}function fs(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!fc(e)&&Pv(e)===n}catch{return!1}}function gc(n){return n instanceof io}function Pv(n){let e=n;for(;e!=null;){const t=Ba(e);if(gc(t))return t;e=gs(e)}return null}function Ba(n){return n?n.__lexicalEditor:null}function ii(n){return La(n)||n.isToken()}function vr(n){return ii(n)||n.isSegmented()}function Tr(n){return yo(n)&&n.nodeType===3}function Ov(n){return yo(n)&&n.nodeType===9}function oo(n){let e=n;for(;e!=null;){if(Tr(e))return e;e=e.firstChild}return null}function ga(n,e,t){const r=li[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function Dv(n){return Se(n)||Yi(n)||ct(n)}function _2(n,e){const t=(function(){const s=gu;return gu=null,s})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Ht(),wv();const r=mt(),i=Kr(),o=""+p2++;i._nodeMap.set(o,n),oe(n)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,n.__key=o}function oi(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling(),s=o!==null?o.__key:null,a=i!==null?i.__key:null,u=i!==null?i.getWritable():null,c=o!==null?o.getWritable():null;i===null&&(r.__first=s),o===null&&(r.__last=a),u!==null&&(u.__next=s),c!==null&&(c.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function ha(n){wv(),ca(n)&&de(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=Kr(),i=mt(),o=r._nodeMap,s=i._dirtyElements;t!==null&&(function(u,c,d){let f=u;for(;f!==null;){if(d.has(f))return;const g=c.get(f);if(g===void 0)break;d.set(f,!1),f=g.__parent}})(t,o,s);const a=e.__key;i._dirtyType=1,oe(n)?s.set(a,!0):i._dirtyLeaves.add(a)}function Vt(n){Ht();const e=mt(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=St(t);r!==null&&r.getWritable()}if(n!==null){const r=St(n);r!==null&&r.getWritable()}}}function Mr(){return cs()?null:mt()._compositionKey}function St(n,e){const t=(e||Kr())._nodeMap.get(n);return t===void 0?null:t}function Iv(n,e){const t=Ua(n,mt());return t!==void 0?St(t,e):null}function Ua(n,e){return n[`__lexicalKey_${e._key}`]}function so(n,e){let t=n;for(;t!=null;){const r=Iv(t,e);if(r!==null)return r;t=gs(t)}return null}function Fv(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Jd(n){return n.read(()=>Pt().getTextContent())}function Pt(){return Lv(Kr())}function Lv(n){return n._nodeMap.get("root")}function Zt(n){Ht();const e=Kr();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Ui(n){const e=mt(),t=(function(r,i){let o=r;for(;o!=null;){const s=Ua(o,i);if(s!==void 0)return s;o=gs(o)}return null})(n,e);return t===null?n===e.getRootElement()?St("root"):null:St(t)}function Rv(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function hc(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function zv(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Bv(n){return Tr(n)?n.nodeValue:null}function vc(n,e,t){const r=Hn(Dn(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let a=Bv(i);const u=so(i);if(a!==null&&Se(u)){if(a===Ea&&t){const c=t.length;a=t,o=c,s=c}a!==null&&pc(u,a,o,s,n)}}}function pc(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let a=e;(s||i)&&e[e.length-1]===Ea&&(a=e.slice(0,-1));const u=o.getTextContent();if(i||a!==u){if(a===""){if(Vt(null),ls||po||us)o.remove();else{const m=mt();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),d=bo(),f=o.getTextContentSize(),g=Mr(),p=o.getKey();if(o.isToken()||g!==null&&p===g&&!s||ue(d)&&(c!==null&&!c.canInsertTextBefore()&&d.anchor.offset===0||d.anchor.key===n.__key&&d.anchor.offset===0&&!o.canInsertTextBefore()&&!s||d.focus.key===n.__key&&d.focus.offset===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const v=be();if(!ue(v)||t===null||r===null)return void qd(o,a,v);if(v.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=Bt(o.getTextContent());o.replace(m),o=m}qd(o,a,v)}}}function qd(n,e,t){if(n.setTextContent(e),ue(t)){const r=n.getKey();for(const i of["anchor","focus"]){const o=t[i];o.type==="text"&&o.key===r&&(o.offset=Lr(n,o.offset,"clamp"))}}}function Ps(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function b2(n,e){return Ps(n,e,"altKey")&&Ps(n,e,"ctrlKey")&&Ps(n,e,"shiftKey")&&Ps(n,e,"metaKey")}function ht(n,e,t){return b2(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const gr={ctrlKey:!Fn,metaKey:Fn},Gd={altKey:Fn,ctrlKey:!Fn};function Yd(n){return n.key==="Backspace"}function Zd(n){return ht(n,"a",gr)}function y2(n){const e=Pt();if(ue(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),ro(n),n}{const t=e.select(0,e.getChildrenSize());return Zt(ro(t)),t}}function Zi(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=jr(i);return t[e]=o,o}return i}function mc(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,a=e.get(o);a===void 0&&de(33,o);const u=a.klass;let c=n.get(u);c===void 0&&(c=new Map,n.set(u,c));const d=c.get(s),f=d==="destroyed"&&i==="created";(d===void 0||f)&&c.set(s,f?"updated":i)}function Xd(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function hu(n,e){const t=n.offset;if(n.type==="element")return Xd(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?Xd(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function Uv(n){const e=Dn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function Ne(n,e,t){return(function(r,i,o){const s=hc(r);for(let a=4;a>=0;a--)for(let u=0;u<s.length;u++){const c=s[u],d=c._commands.get(i);if(d!==void 0){const f=d[a];if(f!==void 0){const g=Array.from(f),p=g.length;let v=!1;if(er(c,()=>{for(let m=0;m<p;m++)if(g[m](o,r))return void(v=!0)}),v)return v}}}return!1})(n,e,t)}function di(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&de(75,e),t}function gs(n){const e=n.assignedSlot||n.parentElement;return mu(e)?e.host:e}function jv(n){return Ov(n)?n:Ft(n)?n.ownerDocument:null}function x2(n){Ht(),mt()._updateTags.add(n)}function w2(n){Ht(),mt()._deferred.push(n)}function vu(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function _c(n){const e=jv(n);return e?e.defaultView:null}function Dn(n){const e=n._window;return e===null&&de(78),e}function k2(n){let e=n.getParentOrThrow();for(;e!==null;){if(un(e))return e;e=e.getParentOrThrow()}return e}function un(n){return zt(n)||oe(n)&&n.isShadowRoot()}function dn(n){const e=mt(),t=n.getType(),r=dc(e,t);r===void 0&&de(200,n.constructor.name,t);const{replace:i,replaceWithKlass:o}=r;if(i!==null){const s=i(n),a=s.constructor;return o!==null?s instanceof o||de(201,o.name,o.getType(),a.name,a.getType(),n.constructor.name,t):s instanceof n.constructor&&a!==n.constructor||de(202,a.name,a.getType(),n.constructor.name,t),s.__key===n.__key&&de(203,n.constructor.name,t,a.name,a.getType()),s}return n}function hl(n,e){!zt(n.getParent())||oe(e)||ct(e)||de(99)}function S2(n){const e=St(n);return e===null&&de(63,n),e}function vl(n){return(ct(n)||oe(n)&&!n.canBeEmpty())&&!n.isInline()}function pu(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Hn(n){return Kn?(n||window).getSelection():null}function C2(n){const e=_c(n);return e?e.getSelection():null}function Wv(n){return Ft(n)&&n.tagName==="A"}function Ft(n){return yo(n)&&n.nodeType===1}function yo(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function mu(n){return yo(n)&&n.nodeType===11}function _u(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function va(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function wn(n){if(ct(n)&&!n.isInline())return!0;if(!oe(n)||un(n))return!1;const e=n.getFirstChild(),t=e===null||Yi(e)||Se(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function ja(){return mt()}const Qd=new WeakMap,T2=new Map;function $d(n){if(!n._readOnly&&n.isEmpty())return T2;n._readOnly||de(192);let e=Qd.get(n);return e||(e=(function(t){const r=new Map;for(const[i,o]of t._nodeMap){const s=o.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(i,o)}return r})(n),Qd.set(n,e)),e}function Kv(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function E2(n){return(e=Kv(n))[vv]=!0,e;var e}function bc(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function N2(n){return n.__lexicalUnmanaged===!0}function Co(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==$n[e]}function Wa(n){const e=cd in n.prototype?n.prototype[cd]():void 0,t=(function(s){if(!(s===$n||s.prototype instanceof $n)){let a="<unknown>",u="<unknown>";try{a=s.getType()}catch{}try{io.version&&(u=JSON.parse(io.version))}catch{}de(290,s.name,a,u)}return s===Si||s===yn||s===$n})(n),r=!t&&Co(n,"getType")?n.getType():void 0;let i,o=r;if(e)if(r)i=e[r];else for(const[s,a]of Object.entries(e))o=s,i=a;if(!t&&o&&(Co(n,"getType")||(n.getType=()=>o),Co(n,"clone")||(n.clone=s=>(cc(s),new n)),Co(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(s=>new n().updateFromJSON(s))),!Co(n,"importDOM")&&i)){const{importDOM:s}=i;s&&(n.importDOM=()=>s)}return{ownNodeConfig:i,ownNodeType:o}}function A2(n){const e=ja();return Ht(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const rn=(n,e)=>{let t=n;for(;t!=null&&!zt(t);){if(e(t))return t;t=t.getParent()}return null},M2={next:"previous",previous:"next"};class yc{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Hv({hasNext:ao,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Gt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Gt(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let o=this;const s=this.getParentAtCaret(),a=new Map;for(let u=o.getAdjacentCaret();u!==null&&a.size<e;u=u.getAdjacentCaret()){const c=u.origin.getWritable();a.set(c.getKey(),c)}for(const u of i){if(a.size>0){const c=o.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(u.getKey()),!(c.is(u)||o.origin.is(u))){const d=u.getParent();d&&d.is(s)&&u.remove(),c.replace(u)}}else c===null&&de(263,Array.from(a).join(" "))}else o.insert(u);o=Gt(u,this.direction)}for(const u of a.values())u.remove();return this}}class $o extends yc{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:jn(e,this.direction)}getParentCaret(e="root"){return Gt(xc(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=xo(this.direction);return Gt(this.getNodeAtCaret(),e)||jn(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof $o&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const P2={root:zt,shadowRoot:un};function xo(n){return M2[n]}function xc(n,e="root"){return P2[e](n)?null:n}class fi extends yc{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Gt(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return oe(this.origin)?jn(this.origin,this.direction):null}getParentCaret(e="root"){return Gt(xc(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=xo(this.direction);return Gt(this.getNodeAtCaret(),e)||jn(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof fi&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof fi||e instanceof gi)&&this.direction===e.direction&&this.origin.is(e.origin)}}class gi extends yc{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:hi(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Gt(xc(this.getParentAtCaret(),e),this.direction)}getFlipped(){return hi(this.origin,xo(this.direction),this.offset)}isSamePointCaret(e){return e instanceof gi&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof fi||e instanceof gi)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Gt(this.origin,this.direction)}}function Fr(n){return n instanceof gi}function ao(n){return n instanceof fi}function tr(n){return n instanceof $o}const O2={next:class extends gi{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends gi{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},D2={next:class extends fi{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends fi{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},I2={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function Gt(n,e){return n?new D2[e](n):null}function hi(n,e,t){return n?new O2[e](n,Lr(n,t)):null}function Lr(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&Oh(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function ef(n,e){return new L2(n,e)}function jn(n,e){return oe(n)?new I2[e](n):null}function F2(n){return n&&n.getChildCaret()||n}function wc(n){return n&&F2(n.getAdjacentCaret())}class kc{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new kc(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const o=this[i].getLatest();return Fr(o)?(function(s,a){const{direction:u,origin:c}=s,d=Lr(c,a==="focus"?xo(u):u);return ef(s,d-s.offset)})(o,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:o}=r;if(i.isSameNodeCaret(o))return[ef(i,o.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Fr(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=Fr(r),o=s=>s.isSameNodeCaret(r)?null:wc(s)||s.getParentCaret(e);return Hv({hasNext:s=>s!==null&&!(i&&r.isSameNodeCaret(s)),initial:t.isSameNodeCaret(r)?null:o(t),map:s=>s,step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class L2{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),o=e.getTextContent();return hi(e.setTextContent(o.slice(0,r)+o.slice(i)),t,r)}}function Sc(n){return Ur(n,Gt(Pt(),n.direction))}function R2(n){return Ur(n,n)}function Ur(n,e){return n.direction!==e.direction&&de(265),new kc(n,e,n.direction)}function Hv(n){const{initial:e,hasNext:t,step:r,map:i}=n;let o=e;return{[Symbol.iterator](){return this},next(){if(!t(o))return{done:!0,value:void 0};const s={done:!1,value:i(o)};return o=r(o),s}}}function Vv(n,e){const t=Hs(n.origin,e.origin);switch(t===null&&de(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(o,s){return Math.sign(o-s)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return Jv(t)}}function Jv(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let o=e,s=t;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;if(s.__key===r)return 1}return o===null?1:-1}function Os(n,e){return e.is(n)}function tf(n){return oe(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function Hs(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=tf(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=tf(e);r;i=r,r=r.getParent()){const o=t.get(r);if(o!==void 0)return o===null?(Os(n,r)||de(276),{commonAncestor:r,type:"ancestor"}):i===null?(Os(e,r)||de(277),{commonAncestor:r,type:"descendant"}):((oe(o)||Os(n,o))&&(oe(i)||Os(e,i))&&r.is(o.getParent())&&r.is(i.getParent())||de(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}function Cr(n,e){const{type:t,key:r,offset:i}=n,o=S2(n.key);return t==="text"?(Se(o)||de(266,o.getType(),r),hi(o,e,i)):(oe(o)||de(267,o.getType(),r),U2(o,n.offset,e))}function vi(n,e){const{origin:t,direction:r}=e,i=r==="next";Fr(e)?n.set(t.getKey(),e.offset,"text"):ao(e)?Se(t)?n.set(t.getKey(),Lr(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(tr(e)&&oe(t)||de(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function z2(n){const e=be(),t=ue(e)?e:nc();return Vs(t,n),Zt(t),t}function Vs(n,e){vi(n.anchor,e.anchor),vi(n.focus,e.focus)}function nf(n){const{anchor:e,focus:t}=n,r=Cr(e,"next"),i=Cr(t,"next"),o=Vv(r,i)<=0?"next":"previous";return Ur(lo(r,o),lo(i,o))}function Cc(n){const{direction:e,origin:t}=n,r=Gt(t,xo(e)).getNodeAtCaret();return r?Gt(r,e):jn(t.getParentOrThrow(),e)}function rf(n,e="root"){const t=[n];for(let r=tr(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Cc(r));return t}function pl(n){return!!n&&n.origin.isAttached()}function B2(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const o=Gv(n,r),s=rf(o.anchor,t),a=rf(o.focus.getFlipped(),t),u=new Set,c=[];for(const v of o.iterNodeCarets(t))if(tr(v))u.add(v.origin.getKey());else if(ao(v)){const{origin:m}=v;oe(m)&&!u.has(m.getKey())||c.push(m)}for(const v of c)v.remove();for(const v of o.getTextSlices()){if(!v)continue;const{origin:m}=v.caret,h=m.getTextContentSize(),w=Cc(Gt(m,r)),b=m.getMode();if(Math.abs(v.distance)===h&&i==="removeEmptySlices"||b==="token"&&v.distance!==0)w.remove();else if(v.distance!==0){i="removeEmptySlices";let x=v.removeTextSlice();const S=v.caret.origin;if(b==="segmented"){const k=x.origin,C=Bt(k.getTextContent()).setStyle(k.getStyle()).setFormat(k.getFormat());w.replaceOrInsert(C),x=hi(C,r,x.offset)}S.is(s[0].origin)&&(s[0]=x),S.is(a[0].origin)&&(a[0]=x.getFlipped())}}let d,f;for(const v of s)if(pl(v)){d=Sn(v);break}for(const v of a)if(pl(v)){f=Sn(v);break}const g=(function(v,m,h){if(!v||!m)return null;const w=v.getParentAtCaret(),b=m.getParentAtCaret();if(!w||!b)return null;const x=w.getParents().reverse();x.push(w);const S=b.getParents().reverse();S.push(b);const k=Math.min(x.length,S.length);let C;for(C=0;C<k&&x[C]===S[C];C++);const N=(D,L)=>{let V;for(let G=C;G<D.length;G++){const U=D[G];if(un(U))return;!V&&L(U)&&(V=U)}return V},O=N(x,wn),E=O&&N(S,D=>h.has(D.getKey())&&wn(D));return O&&E?[O,E]:null})(d,f,u);if(g){const[v,m]=g;jn(v,"previous").splice(0,m.getChildren()),m.remove()}const p=[d,f,...s,...a].find(pl);if(p)return R2(lo(Sn(p),n.direction));de(269,JSON.stringify(s.map(v=>v.origin.__key)))}function Sn(n){const e=(function(i){let o=i;for(;tr(o);){const s=wc(o);if(!tr(s))break;o=s}return o})(n.getLatest()),{direction:t}=e;if(Se(e.origin))return Fr(e)?e:hi(e.origin,t,t);const r=e.getAdjacentCaret();return ao(r)&&Se(r.origin)?hi(r.origin,t,xo(t)):e}function qv(n){return Fr(n)&&n.offset!==Lr(n.origin,n.direction)}function lo(n,e){return n.direction===e?n:n.getFlipped()}function Gv(n,e){return n.direction===e?n:Ur(lo(n.focus,e),lo(n.anchor,e))}function U2(n,e,t){let r=jn(n,"next");for(let i=0;i<e;i++){const o=r.getAdjacentCaret();if(o===null)break;r=o}return lo(r,t)}function j2(...n){return n}function W2(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function jr(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function ar(n,...e){const t=jr(...e);t.length>0&&n.classList.add(...t)}function Tc(n,...e){const t=jr(...e);t.length>0&&n.classList.remove(...t)}function lr(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const bu=new Map;function Yv(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function of(n){let e=bu.get(n);return e===void 0&&(e=Yv(n),bu.set(n,e)),e}function Zv(n){const e=ja().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function Xv(n){return Zv(zt(n)?n:n.getParentOrThrow())}function sf(n){const e=Xv(n);return e!==null&&e.direction==="rtl"}function Qv(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!vr(e)&&r!==null){const[i,o]=r,s=n.isBackward(),a=i.getNode(),u=o.getNode(),c=e.is(a),d=e.is(u);if(c||d){const[f,g]=du(n),p=a.is(u),v=e.is(s?u:a),m=e.is(s?a:u);let h,w=0;p?(w=f>g?g:f,h=f>g?f:g):v?(w=s?g:f,h=void 0):m&&(w=0,h=s?f:g);const b=e.__text.slice(w,h);b!==e.__text&&(t==="clone"&&(e=E2(e)),e.__text=b)}}return e}function K2(n){const e=n.getStyle(),t=Yv(e);bu.set(e,t)}function H2(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function Ka(n,e,t=H2){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let o=null;if(r){const[s,a]=r;o=nc(),o.anchor.set(s.key,s.offset,s.type),o.focus.set(a.key,a.offset,a.type);const u=rn(s.getNode(),wn),c=rn(a.getNode(),wn);oe(u)&&i.set(u.getKey(),u),oe(c)&&i.set(c.getKey(),c)}for(const s of n.getNodes())if(oe(s)&&wn(s))i.set(s.getKey(),s);else if(r===null){const a=rn(s,wn);oe(a)&&i.set(a.getKey(),a)}for(const[s,a]of i){const u=e();t(a,u),a.replace(u,!0),o&&(s===o.anchor.key&&o.anchor.set(u.getKey(),o.anchor.offset,o.anchor.type),s===o.focus.key&&o.focus.set(u.getKey(),o.focus.offset,o.focus.type))}o&&n.is(be())&&Zt(o)}function $v(n){const e=ep(n);return e!==null&&e.writingMode==="vertical-rl"}function ep(n){const e=n.anchor.getNode();return oe(e)?Zv(e):Xv(e)}function af(n,e){let t=$v(n)?!e:e;tp(n)&&(t=!t);const r=Cr(n.focus,t?"previous":"next");if(qv(r))return!1;for(const i of Sc(r)){if(tr(i))return!i.origin.isInline();if(!oe(i.origin)){if(ct(i.origin))return!0;break}}return!1}function V2(n,e,t,r){n.modify(e?"extend":"move",t,r)}function tp(n){const e=ep(n);return e!==null&&e.direction==="rtl"}function lf(n,e,t){const r=tp(n);let i;i=$v(n)||r?!t:t,V2(n,e,i,"character")}function J2(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ha=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,q2=Ha&&"documentMode"in document?document.documentMode:null,G2=Ha&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Ha||!("InputEvent"in window)||q2)&&"getTargetRanges"in new window.InputEvent("input");const np=Ha,Y2=G2;function Z2(n){return n?n.getAdjacentCaret():null}function rp(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function ip(n){const e=rn(n,t=>oe(t)&&!t.isInline());return oe(e)||J2(4,n.__key),e}function Pr(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}let ml=!(Y2||!np)&&void 0;function uf(n,e=!1){let t=1;if((function(){if(ml===void 0){const r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),ml=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return ml})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function X2(n,e){const t=Ov(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const o of t)if(!sp.has(o.nodeName)){const s=ap(o,n,i,!1);s!==null&&(r=r.concat(s))}return(function(o){for(const s of o)s.getNextSibling()instanceof ac&&s.insertAfter(Sr());for(const s of o){const a=s.getChildren();for(const u of a)s.insertBefore(u);s.remove()}})(i),r}function Q2(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Pt().getChildren();for(let i=0;i<r.length;i++)op(n,r[i],t,e);return t.innerHTML}function op(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=oe(e)&&e.excludeFromCopy("html");let s=e;r!==null&&Se(e)&&(s=Qv(r,e,"clone"));const a=oe(s)?s.getChildren():[],u=dc(n,s.getType());let c;c=u&&u.exportDOM!==void 0?u.exportDOM(n,s):s.exportDOM(n);const{element:d,after:f}=c;if(!d)return!1;const g=document.createDocumentFragment();for(let p=0;p<a.length;p++){const v=a[p],m=op(n,v,g,r);!i&&oe(e)&&m&&e.extractWithChild(v,r,"html")&&(i=!0)}if(i&&!o){if((Ft(d)||mu(d))&&d.append(g),t.append(d),f){const p=f.call(s,d);p&&(mu(d)?d.replaceChildren(p):d.replaceWith(p))}}else t.append(g);return i}const sp=new Set(["STYLE","SCRIPT"]);function ap(n,e,t,r,i=new Map,o){let s=[];if(sp.has(n.nodeName))return s;let a=null;const u=(function(v,m){const{nodeName:h}=v,w=m._htmlConversions.get(h.toLowerCase());let b=null;if(w!==void 0)for(const x of w){const S=x(v);S!==null&&(b===null||(b.priority||0)<=(S.priority||0))&&(b=S)}return b!==null?b.conversion:null})(n,e),c=u?u(n):null;let d=null;if(c!==null){d=c.after;const v=c.node;if(a=Array.isArray(v)?v[v.length-1]:v,a!==null){for(const[,m]of i)if(a=m(a,o),!a)break;a&&s.push(...Array.isArray(v)?v:[a])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let g=[];const p=(a==null||!un(a))&&(a!=null&&fu(a)||r);for(let v=0;v<f.length;v++)g.push(...ap(f[v],e,t,p,new Map(i),a));return d!=null&&(g=d(g)),va(n)&&(g=$2(n,g,p?()=>{const v=new ac;return t.push(v),v}:Ct)),a==null?g.length>0?s=s.concat(g):va(n)&&(function(v){return v.nextSibling==null||v.previousSibling==null?!1:_u(v.nextSibling)&&_u(v.previousSibling)})(n)&&(s=s.concat(Sr())):oe(a)&&a.append(...g),s}function $2(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const a=e[s];if(fu(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(o.push(a),s===e.length-1||s<e.length-1&&fu(e[s+1])){const u=t();u.setFormat(r),u.append(...o),i.push(u),o=[]}}return i}function pa(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ek(n,e=be()){return e==null&&pa(166),ue(e)&&e.isCollapsed()||e.getNodes().length===0?"":Q2(n,e)}function tk(n,e=be()){return e==null&&pa(166),ue(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(nk(n,e))}function cf(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return df(t,rk(a.nodes),e)}catch(a){console.error(a)}const i=n.getData("text/html"),o=n.getData("text/plain");if(i&&o!==i)try{const a=new DOMParser().parseFromString((function(u){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(u):u})(i),"text/html");return df(t,X2(t,a),e)}catch(a){console.error(a)}const s=o||n.getData("text/uri-list");if(s!=null)if(ue(e)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let u=0;u<a.length;u++){const c=be();if(ue(c)){const d=a[u];d===`
|
|
26
|
-
`||d===`\r
|
|
27
|
-
`?c.insertParagraph():d===" "?c.insertNodes([_o()]):c.insertText(d)}}}else e.insertRawText(s)}function df(n,e,t){n.dispatchCommand(Dw,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(ue(r)&&r.isCollapsed()){const i=r.anchor;let o=null;const s=Cr(i,"previous");if(s)if(Fr(s))o=s.origin;else{const a=Ur(s,jn(Pt(),"next").getFlipped());for(const u of a){if(Se(u.origin)){o=u.origin;break}if(oe(u.origin)&&!u.origin.isInline())break}}if(o&&Se(o)){const a=o.getFormat(),u=o.getStyle();r.format===a&&r.style===u||(r.format=a,r.style=u,r.dirty=!0)}}})(t))}function lp(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=oe(t)&&t.excludeFromCopy("html");let s=t;e!==null&&Se(s)&&(s=Qv(e,s,"clone"));const a=oe(s)?s.getChildren():[],u=(function(c){const d=c.exportJSON(),f=c.constructor;if(d.type!==f.getType()&&pa(58,f.name),oe(c)){const g=d.children;Array.isArray(g)||pa(59,f.name)}return d})(s);Se(s)&&s.getTextContentSize()===0&&(i=!1);for(let c=0;c<a.length;c++){const d=a[c],f=lp(n,e,d,u.children);!i&&oe(t)&&f&&t.extractWithChild(d,e,"clone")&&(i=!0)}if(i&&!o)r.push(u);else if(Array.isArray(u.children))for(let c=0;c<u.children.length;c++){const d=u.children[c];r.push(d)}return i}function nk(n,e){const t=[],r=Pt().getChildren();for(let i=0;i<r.length;i++)lp(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function rk(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=f2(r);Se(i)&&K2(i),e.push(i)}return e}let Mi=null;async function ff(n,e,t){if(Mi!==null)return!1;if(e!==null)return new Promise((c,d)=>{n.update(()=>{c(gf(n,e,t))})});const r=n.getRootElement(),i=n._window||window,o=i.document,s=Hn(i);if(r===null||s===null)return!1;const a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);const u=new Range;return u.setStart(a,0),u.setEnd(a,1),s.removeAllRanges(),s.addRange(u),new Promise((c,d)=>{const f=n.registerCommand(Fa,g=>(Pr(g,ClipboardEvent)&&(f(),Mi!==null&&(i.clearTimeout(Mi),Mi=null),c(gf(n,g,t))),!0),Ev);Mi=i.setTimeout(()=>{f(),Mi=null,c(!1)},50),o.execCommand("copy"),a.remove()})}function gf(n,e,t){if(t===void 0){const i=Hn(n._window),o=be();if(!o||o.isCollapsed()||!i)return!1;const s=i.anchorNode,a=i.focusNode;if(s!==null&&a!==null&&!fs(n,s,a))return!1;t=ik(o)}e.preventDefault();const r=e.clipboardData;return r!==null&&(ok(r,t),!0)}const up=[["text/html",ek],["application/x-lexical-editor",tk]];function ik(n=be()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=ja();for(const[r,i]of up){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function ok(n,e){for(const[t]of up)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const sk=Symbol.for("preact-signals");function Va(){if(Rr>1)return void Rr--;let n,e=!1;for(;zo!==void 0;){let t=zo;for(zo=void 0,yu++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&cp(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(yu=0,Rr--,e)throw n}function ak(n){if(Rr>0)return n();Rr++;try{return n()}finally{Va()}}let ft,zo;function hf(n){const e=ft;ft=void 0;try{return n()}finally{ft=e}}let Rr=0,yu=0,Js=0;function vf(n){if(ft===void 0)return;let e=n.n;return e===void 0||e.t!==ft?(e={i:0,S:n,p:ft.s,n:void 0,t:ft,e:void 0,x:void 0,r:e},ft.s!==void 0&&(ft.s.n=e),ft.s=e,n.n=e,32&ft.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ft.s,e.n=void 0,ft.s.n=e,ft.s=e),e):void 0}function tn(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function lk(n,e){return new tn(n,e)}function cp(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function pf(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function dp(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Pi(n,e){tn.call(this,void 0),this.x=n,this.s=void 0,this.g=Js-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function fp(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Rr++;const t=ft;ft=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Ec(n),r}finally{ft=t,Va()}}}function Ec(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,fp(n)}function uk(n){if(ft!==this)throw new Error("Out-of-order effect");dp(this),ft=n,this.f&=-2,8&this.f&&Ec(this),Va()}function zi(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function Nc(n,e){const t=new zi(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function ck(n,e={}){const t={};for(const r in n){const i=e[r],o=lk(i===void 0?n[r]:i);t[r]=o}return t}tn.prototype.brand=sk,tn.prototype.h=function(){return!0},tn.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:hf(()=>{var t;(t=this.W)==null||t.call(this)}))},tn.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&hf(()=>{var r;(r=this.Z)==null||r.call(this)}))}},tn.prototype.subscribe=function(n){return Nc(()=>{const e=this.value,t=ft;ft=void 0;try{n(e)}finally{ft=t}},{name:"sub"})},tn.prototype.valueOf=function(){return this.value},tn.prototype.toString=function(){return this.value+""},tn.prototype.toJSON=function(){return this.value},tn.prototype.peek=function(){const n=ft;ft=void 0;try{return this.value}finally{ft=n}},Object.defineProperty(tn.prototype,"value",{get(){const n=vf(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(yu>100)throw new Error("Cycle detected");this.v=n,this.i++,Js++,Rr++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Va()}}}}),Pi.prototype=new tn,Pi.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Js))return!0;if(this.g=Js,this.f|=1,this.i>0&&!cp(this))return this.f&=-2,!0;const n=ft;try{pf(this),ft=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ft=n,dp(this),this.f&=-2,!0},Pi.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}tn.prototype.S.call(this,n)},Pi.prototype.U=function(n){if(this.t!==void 0&&(tn.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Pi.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Pi.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=vf(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),zi.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},zi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,fp(this),pf(this),Rr++;const n=ft;return ft=this,uk.bind(this,n)},zi.prototype.N=function(){2&this.f||(this.f|=2,this.o=zo,zo=this)},zi.prototype.d=function(){this.f|=8,1&this.f||Ec(this)},zi.prototype.dispose=function(){this.d()};function dk(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function bt(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function gp(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=gp(t[i],r[i]);return n}return e}const Ac=0,xu=1,hp=2,_l=3,Ds=4,Oi=5,bl=6,To=7;function yl(n){return n.id===Ac}function vp(n){return n.id===hp}function fk(n){return(function(e){return e.id===xu})(n)||bt(305,String(n.id),String(xu)),Object.assign(n,{id:hp})}const gk=new Set;let hk=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Ac}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):W2;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;vp(t)||bt(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=(function(a,u,c){return Object.assign(a,{config:u,id:_l,registerState:c})})(t,this.mergeConfigs(),r);let s;this.state=o,this.extension.init&&(s=this.extension.init(e,o.config,r)),this.state=(function(a,u,c){return Object.assign(a,{id:Ds,initResult:u,registerState:c})})(o,s,i)}build(e){const t=this.state;let r;t.id!==Ds&&bt(307,String(t.id),String(Oi)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(o,s,a){return Object.assign(o,{id:Oi,output:s,registerState:a})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==Oi&&bt(308,String(r.id),String(Oi));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(o){return Object.assign(o,{id:bl})})(r),()=>{const o=this.state;o.id!==To&&bt(309,String(r.id),String(To)),this.state=(function(s){return Object.assign(s,{id:Oi})})(o),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==bl&&bt(310,String(t.id),String(bl)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:To})})(t),r}getSignal(){return this._signal===void 0&&bt(311),this._signal}getInitResult(){this.extension.init===void 0&&bt(312,this.extension.name);const e=this.state;return(function(t){return t.id>=Ds})(e)||bt(313,String(e.id),String(Ds)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=_l})(e)||bt(314,String(e.id),String(_l)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&bt(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&bt(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=To})(e)||bt(316,String(e.id),String(To)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||gk}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Oi})(e)||bt(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const mf={tag:ri};function vk(){const n=Pt();n.isEmpty()&&n.append(Ct())}const pk={config:{setOptions:mf,updateOptions:mf},init:({$initialEditorState:n=vk})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:o}=i;if(g2(o))n.setEditorState(o,t);else if(typeof o=="function")n.update(()=>{o(n)},e);else if(o&&(typeof o=="string"||typeof o=="object")){const s=n.parseEditorState(o);n.setEditorState(s,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Ci,On,wi,mo,Ti]},_f=Symbol.for("@lexical/extension/LexicalBuilder");function bf(){}function mk(n){throw n}function Is(n){return Array.isArray(n)?n:[n]}const xl="0.40.0+prod.esm";let _k=class qs{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=xl,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Is(pk)];for(const r of e)t.push(Is(r));return new qs(t)}static maybeFromEditor(e){const t=e[_f];return t&&(t.PACKAGE_VERSION!==xl&&bt(292,t.PACKAGE_VERSION,xl),t instanceof qs||bt(293)),t}static fromEditor(e){const t=qs.maybeFromEditor(e);return t===void 0&&bt(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(uc({...r,...t?{onError:o=>{t(o,i)}}:{}}),{[_f]:this});for(const o of this.sortedExtensionReps())o.build(i);return i}buildEditor(){let e=bf;function t(){try{e()}finally{e=bf}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=lr(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&bt(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const o=this.incomingEdges.get(t);o?o.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&bt(296);const t=Is(e),[r]=t;typeof r.name!="string"&&bt(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&bt(298,r.name),!i){i=new hk(this,r),this.extensionNameMap.set(r.name,i);const o=this.conflicts.get(r.name);typeof o=="string"&&bt(299,r.name,o);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&bt(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Is(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let o=r.state;if(vp(o))return;const s=r.extension.name;var a;yl(o)||bt(300,s,i||"[unknown]"),yl(a=o)||bt(304,String(a.id),String(Ac)),o=Object.assign(a,{id:xu}),r.state=o;const u=this.outgoingConfigEdges.get(s);if(u)for(const c of u.keys()){const d=this.extensionNameMap.get(c);d&&t(d,s)}o=fk(o),r.state=o,e.push(r)};for(const r of this.extensionNameMap.values())yl(r.state)&&t(r);for(const r of e)for(const[i,o]of this.outgoingConfigEdges.get(r.extension.name)||[])if(o.length>0){const s=this.extensionNameMap.get(i);if(s)for(const a of o)s.configs.add(a)}for(const[r,...i]of this.roots)if(i.length>0){const o=this.extensionNameMap.get(r.name);o===void 0&&bt(301,r.name);for(const s of i)o.configs.add(s)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],o=r.signal;for(const s of t){const a=s.register(e,o);a&&i.push(a)}for(const s of t){const a=s.afterRegistration(e);a&&i.push(a)}return lr(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,o={},s={},a=this.sortedExtensionReps();for(const d of a){const{extension:f}=d;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const g of dk(f)){if(typeof g!="function"){const p=r.get(g.replace);p&&bt(302,f.name,g.replace.name,p.extension.name),r.set(g.replace,d)}t.add(g)}if(f.html){if(f.html.export)for(const[g,p]of f.html.export.entries())i.set(g,p);f.html.import&&Object.assign(o,f.html.import)}f.theme&&gp(s,f.theme)}Object.keys(s).length>0&&(e.theme=s),t.size&&(e.nodes=[...t]);const u=Object.keys(o).length>0,c=i.size>0;(u||c)&&(e.html={},u&&(e.html.import=o),c&&(e.html.export=i));for(const d of a)d.init(e);return e.onError||(e.onError=mk),e}};function bk(n,e){const t=_k.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function fn(){return to("editor")}function yk(n){bi("editor",n)}function xk(){return to("isEditable")}function wk(n){bi("historyState",n)}function kk(){bi("editorSharedContext",{})}function Sk(){return to("editorSharedContext")}function Ck(){return Sk().ImageHistoryComponentType}function yf(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Ei=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Tk=Ei&&"documentMode"in document?document.documentMode:null,Ek=Ei&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Nk=!(!Ei||!("InputEvent"in window)||Tk)&&"getTargetRanges"in new window.InputEvent("input"),Ak=Ei&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),xf=Ei&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Mk=Ei&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Pk=Ei&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ek&&!Mk,wf=Le("DRAG_DROP_PASTE_FILE");class Ja extends yn{static getType(){return"quote"}static clone(e){return new Ja(e.__key)}createDOM(e){const t=document.createElement("blockquote");return ar(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Ok,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Mc().updateFromJSON(e)}insertNewAfter(e,t){const r=Ct(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=Ct();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function Mc(){return dn(new Ja)}class hs extends yn{__tag;static getType(){return"heading"}static clone(e){return new hs(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const o=i[t];ar(r,o)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Di,priority:0}),h2:e=>({conversion:Di,priority:0}),h3:e=>({conversion:Di,priority:0}),h4:e=>({conversion:Di,priority:0}),h5:e=>({conversion:Di,priority:0}),h6:e=>({conversion:Di,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&kf(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>kf(e)?{conversion:t=>({node:ji("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ft(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return ji(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),o=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?Ct():ji(this.getTag()),s=this.getDirection();if(o.setDirection(s),this.insertAfter(o,t),r===0&&!this.isEmpty()&&e){const a=Ct();a.select(),this.replace(a,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Ct():ji(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}}function kf(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Di(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=ji(e),n.style!==null&&(bc(n,t),t.setFormat(n.style.textAlign))),{node:t}}function Ok(n){const e=Mc();return n.style!==null&&(e.setFormat(n.style.textAlign),bc(n,e)),{node:e}}function ji(n="h1"){return dn(new hs(n))}function Dk(n){return n instanceof hs}function Fs(n){let e=null;if(Pr(n,DragEvent)?e=n.dataTransfer:Pr(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function Sf(n){const e=be();if(!ue(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const a=rn(o,c=>oe(c)&&!c.isInline());if(a===null)continue;const u=a.getKey();a.canIndent()&&!t.has(u)&&(t.add(u),n(a))}return t.size>0}function Cf(n){const e=so(n);return ct(e)}function wl(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function Ik(n){return lr(n.registerCommand(Pa,e=>{const t=be();return!!Et(t)&&(t.clear(),!0)},Xe),n.registerCommand(ni,e=>{const t=be();return ue(t)?(t.deleteCharacter(e),!0):!!Et(t)&&(t.deleteNodes(),!0)},Xe),n.registerCommand(Yo,e=>{const t=be();return!!ue(t)&&(t.deleteWord(e),!0)},Xe),n.registerCommand(Zo,e=>{const t=be();return!!ue(t)&&(t.deleteLine(e),!0)},Xe),n.registerCommand(qi,e=>{const t=be();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)cf(r,t,n);else if(ue(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},Xe),n.registerCommand(tu,()=>{const e=be();return!!ue(e)&&(e.removeText(),!0)},Xe),n.registerCommand(kn,e=>{const t=be();return!!ue(t)&&(t.formatText(e),!0)},Xe),n.registerCommand(ov,e=>{const t=be();if(!ue(t)&&!Et(t))return!1;const r=t.getNodes();for(const i of r){const o=rn(i,s=>oe(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},Xe),n.registerCommand(Ji,e=>{const t=be();return!!ue(t)&&(t.insertLineBreak(e),!0)},Xe),n.registerCommand(Go,()=>{const e=be();return!!ue(e)&&(e.insertParagraph(),!0)},Xe),n.registerCommand(Lw,()=>(Ri([_o()]),!0),Xe),n.registerCommand(Rw,()=>Sf(e=>{const t=e.getIndent();e.setIndent(t+1)}),Xe),n.registerCommand(xd,()=>Sf(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),Xe),n.registerCommand(Qh,e=>{const t=be();if(Et(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(ue(t)){const r=hu(t.focus,!0);if(!e.shiftKey&&ct(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},Xe),n.registerCommand($h,e=>{const t=be();if(Et(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(ue(t)){if((function(i){const o=i.focus;return o.key==="root"&&o.offset===Pt().getChildrenSize()})(t))return e.preventDefault(),!0;const r=hu(t.focus,!1);if(!e.shiftKey&&ct(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},Xe),n.registerCommand(Xh,e=>{const t=be();if(Et(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),sf(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!ue(t))return!1;if(af(t,!0)){const r=e.shiftKey;return e.preventDefault(),lf(t,r,!0),!0}return!1},Xe),n.registerCommand(Zh,e=>{const t=be();if(Et(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),sf(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!ue(t))return!1;const r=e.shiftKey;return!!af(t,!1)&&(e.preventDefault(),lf(t,r,!1),!0)},Xe),n.registerCommand(tv,e=>{if(Cf(e.target))return!1;const t=be();if(ue(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const o=i.getNode();if(zt(o))return!1;const s=ip(o);return s.getIndent()>0&&(s.is(o)||o.is(s.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(xd,void 0);if(xf&&navigator.language==="ko-KR")return!1}else if(!Et(t))return!1;return e.preventDefault(),n.dispatchCommand(ni,!0)},Xe),n.registerCommand(nv,e=>{if(Cf(e.target))return!1;const t=be();return!(!ue(t)&&!Et(t))&&(e.preventDefault(),n.dispatchCommand(ni,!1))},Xe),n.registerCommand(Xo,e=>{const t=be();if(!ue(t))return!1;if(wl(t),e!==null){if((xf||Ak||Pk)&&Nk)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Ji,!1)}return n.dispatchCommand(Go,void 0)},Xe),n.registerCommand(Qu,()=>{const e=be();return!!ue(e)&&(n.blur(),!0)},Xe),n.registerCommand(iv,e=>{const[,t]=Fs(e);if(t.length>0){const i=yf(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,a=so(s);if(a!==null){const u=nc();if(Se(a))u.anchor.set(a.getKey(),o,"text"),u.focus.set(a.getKey(),o,"text");else{const d=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;u.anchor.set(d,f,"element"),u.focus.set(d,f,"element")}const c=ro(u);Zt(c)}n.dispatchCommand(wf,t)}return e.preventDefault(),!0}const r=be();return!!ue(r)},Xe),n.registerCommand($u,e=>{const[t]=Fs(e),r=be();return!(t&&!ue(r))},Xe),n.registerCommand(sv,e=>{const[t]=Fs(e),r=be();if(t&&!ue(r))return!1;const i=yf(e.clientX,e.clientY);if(i!==null){const o=so(i.node);ct(o)&&e.preventDefault()}return!0},Xe),n.registerCommand(nu,()=>(y2(),!0),Xe),n.registerCommand(Fa,e=>(ff(n,Pr(e,ClipboardEvent)?e:null),!0),Xe),n.registerCommand(ec,e=>((async function(t,r){await ff(r,Pr(t,ClipboardEvent)?t:null),r.update(()=>{const i=be();ue(i)?i.removeText():Et(i)&&i.getNodes().forEach(o=>o.remove())})})(e,n),!0),Xe),n.registerCommand(Oa,e=>{const[,t,r]=Fs(e);return t.length>0&&!r?(n.dispatchCommand(wf,t),!0):yo(e.target)&&fc(e.target)?!1:be()!==null&&((function(i,o){i.preventDefault(),o.update(()=>{const s=be(),a=Pr(i,InputEvent)||Pr(i,KeyboardEvent)?null:i.clipboardData;a!=null&&s!==null&&cf(a,s,o)},{tag:Xw})})(e,n),!0)},Xe),n.registerCommand(ev,e=>{const t=be();return ue(t)&&wl(t),!1},Xe),n.registerCommand(rv,e=>{const t=be();return ue(t)&&wl(t),!1},Xe))}function Fk(n,e){he(e,!0);const t=Pm(),r=fn(),i={},o=[];_t(()=>{const s=[];return r._nodes.forEach(a=>{if(a.klass.prototype instanceof Si&&!a.klass.skipDecorateRender){let u=r.registerMutationListener(a.klass,(c,d)=>{for(let[f,g]of c)g==="destroyed"?delete i[f]:o.push(f)});s.push(u)}}),lr(...s,r.registerDecoratorListener(a=>{o.forEach(u=>{const c=a[u],d=i[u],f=r.getElementByKey(u);if(f?.innerHTML&&d){const g=i[u];c.updateProps(g)}else if(f){const g=We({});c.updateProps(g),i[u]=g,oh(c.componentClass,{target:f,props:g,context:t})}}),o.length=0}))}),ve()}function pp(n,e){he(e,!1);const t=fn();_t(()=>Ik(t)),ss(),Fk(n,{}),ve()}function Lk(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return 0;const o=e._selection,s=n._selection;if(i)return 1;if(!(ue(o)&&ue(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const a=(function(w,b,x){const S=w._nodeMap,k=[];for(const C of b){const N=S.get(C);N!==void 0&&k.push(N)}for(const[C,N]of x){if(!N)continue;const O=S.get(C);O===void 0||zt(O)||k.push(O)}return k})(e,t,r);if(a.length===0)return 0;if(a.length>1){const w=e._nodeMap,b=w.get(o.anchor.key),x=w.get(s.anchor.key);return b&&x&&!n._nodeMap.has(b.__key)&&Se(b)&&b.__text.length===1&&o.anchor.offset===1?2:0}const u=a[0],c=n._nodeMap.get(u.__key);if(!Se(c)||!Se(u)||c.__mode!==u.__mode)return 0;const d=c.__text,f=u.__text;if(d===f)return 0;const g=o.anchor,p=s.anchor;if(g.key!==p.key||g.type!=="text")return 0;const v=g.offset,m=p.offset,h=f.length-d.length;return h===1&&m===v-1?2:h===-1&&m===v+1?3:h===-1&&m===v?4:0}function Rk(n,e){let t=Date.now(),r=0;return(i,o,s,a,u,c)=>{const d=Date.now();if(c.has(cu))return r=0,t=d,2;const f=Lk(i,o,a,u,n.isComposing()),g=(()=>{const p=s===null||s.editor===n,v=c.has(Zw);if(!v&&p&&c.has(ri))return 0;if(i===null)return 1;const m=o._selection;if(!(a.size>0||u.size>0))return m!==null?0:2;const h=typeof e=="number"?e:e.peek();return v===!1&&f!==0&&f===r&&d<t+h&&p||a.size===1&&(function(w,b,x){const S=b._nodeMap.get(w),k=x._nodeMap.get(w),C=b._selection,N=x._selection;return!(ue(C)&&ue(N)&&C.anchor.type==="element"&&C.focus.type==="element"&&N.anchor.type==="text"&&N.focus.type==="text"||!Se(S)||!Se(k)||S.__parent!==k.__parent)&&JSON.stringify(b.read(()=>S.exportJSON()))===JSON.stringify(x.read(()=>k.exportJSON()))})(Array.from(a)[0],i,o)?0:1})();return t=d,r=f,g}}function Tf(n){n.undoStack=[],n.redoStack=[],n.current=null}function mp(n,e,t){const r=Rk(n,t);return lr(n.registerCommand(Da,()=>((function(o,s){const a=s.redoStack,u=s.undoStack;if(u.length!==0){const c=s.current,d=u.pop();c!==null&&(a.push(c),o.dispatchCommand(Es,!0)),u.length===0&&o.dispatchCommand(Ns,!1),s.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:cu})}})(n,e),!0),Xe),n.registerCommand(Ia,()=>((function(o,s){const a=s.redoStack,u=s.undoStack;if(a.length!==0){const c=s.current;c!==null&&(u.push(c),o.dispatchCommand(Ns,!0));const d=a.pop();a.length===0&&o.dispatchCommand(Es,!1),s.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:cu})}})(n,e),!0),Xe),n.registerCommand(Bw,()=>(Tf(e),!1),Xe),n.registerCommand(Uw,()=>(Tf(e),n.dispatchCommand(Es,!1),n.dispatchCommand(Ns,!1),!0),Xe),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:c})=>{const d=e.current,f=e.redoStack,g=e.undoStack,p=d===null?null:d.editorState;if(d!==null&&o===p)return;const v=r(s,o,d,a,u,c);if(v===1)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Es,!1)),d!==null&&(g.push({...d}),n.dispatchCommand(Ns,!0));else if(v===2)return;e.current={editor:n,editorState:o}}))}function Pc(){return{current:null,redoStack:[],undoStack:[]}}const kl={build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>ck({delay:e,disabled:r,historyState:t(n)}),config:{createInitialHistoryState:Pc,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(n,e,t)=>{const r=t.getOutput();return Nc(()=>r.disabled.value?void 0:mp(n,r.historyState.value,r.delay))}};j2(kl,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function zk(n,e){he(e,!0);const t=fn();let r=se(e,"externalHistoryState",19,Pc),i=se(e,"delay",3,1e3);_t(()=>mp(t,r(),i())),ve()}function Or(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Bk(n){let e=1,t=n.getParent();for(;t!=null;){if(kt(t)){const r=t.getParent();if(lt(r)){e++,t=r.getParent();continue}Or(40)}return e}return e}function wu(n){let e=n.getParent();lt(e)||Or(40);let t=e;for(;t!==null;)t=t.getParent(),lt(t)&&(e=t);return e}function _p(n){let e=[];const t=n.getChildren().filter(kt);for(let r=0;r<t.length;r++){const i=t[r],o=i.getFirstChild();lt(o)?e=e.concat(_p(o)):e.push(i)}return e}function qn(n){return kt(n)&<(n.getFirstChild())}function Ef(n){return Pn().append(n)}function bp(n,e){return kt(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Nf(n){const e=be();if(e!==null){let t=e.getNodes();if(ue(e)){const i=e.getStartEndPoints();i===null&&Or(143);const[o]=i,s=o.getNode(),a=s.getParent();if(un(s)){const u=s.getFirstChild();if(u)t=u.selectStart().getNodes();else{const c=Ct();s.append(c),t=c.select().getNodes()}}else if(bp(s,t)){const u=bn(n);if(un(a)){s.replace(u);const c=Pn();oe(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),u.append(c)}else if(kt(s)){const c=s.getParentOrThrow();pi(u,c.getChildren()),c.replace(u)}return}}const r=new Set;for(let i=0;i<t.length;i++){const o=t[i];if(oe(o)&&o.isEmpty()&&!kt(o)&&!r.has(o.getKey())){Af(o,n);continue}let s=Dv(o)?o.getParent():kt(o)&&o.isEmpty()?o:null;for(;s!=null;){const a=s.getKey();if(lt(s)){if(!r.has(a)){const u=bn(n);pi(u,s.getChildren()),s.replace(u),r.add(a)}break}{const u=s.getParent();if(un(u)&&!r.has(a)){r.add(a),Af(s,n);break}s=u}}}}}function pi(n,e){n.splice(n.getChildrenSize(),0,e)}function Af(n,e){if(lt(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=Pn();let o;if(pi(i,n.getChildren()),lt(t)&&e===t.getListType())t.append(i),lt(r)&&e===r.getListType()&&(pi(t,r.getChildren()),r.remove()),o=t;else if(lt(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const a=bn(e);a.append(i),n.replace(a),o=a}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const s=be();return ue(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),n.remove(),o}function Oc(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&qn(t)&&qn(r)&&(Oc(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function Uk(){const n=be();if(ue(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(bp(r,t))e.add(wu(r));else for(let i=0;i<t.length;i++){const o=t[i];if(Dv(o)){const s=rp(o,vs);s!=null&&e.add(wu(s))}}for(const i of e){let o=i;const s=_p(i);for(const a of s){const u=Ct().setTextStyle(n.style).setTextFormat(n.format);pi(u,a.getChildren()),o.insertAfter(u),o=u,a.__key===n.anchor.key&&vi(n.anchor,Sn(jn(u,"next"))),a.__key===n.focus.key&&vi(n.focus,Sn(jn(u,"next"))),a.remove()}i.remove()}}}function yp(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())kt(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),lt(r.getFirstChild())||t++)}function jk(n){const e=new Set;if(qn(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(qn(r)&&qn(i)){const o=i.getFirstChild();if(lt(o)){o.append(n);const s=r.getFirstChild();lt(s)&&(pi(o,s.getChildren()),r.remove(),e.add(r.getKey()))}}else if(qn(r)){const o=r.getFirstChild();if(lt(o)){const s=o.getFirstChild();s!==null&&s.insertBefore(n)}}else if(qn(i)){const o=i.getFirstChild();lt(o)&&o.append(n)}else if(lt(t)){const o=Pn().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),s=bn(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());o.append(s),s.append(n),i?i.insertAfter(o):r?r.insertBefore(o):t.append(o)}}function Wk(n){if(qn(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(lt(t?t.getParent():void 0)&&kt(t)&<(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const o=e.getListType(),s=Pn(),a=bn(o);s.append(a),n.getPreviousSiblings().forEach(d=>a.append(d));const u=Pn(),c=bn(o);u.append(c),pi(c,n.getNextSiblings()),t.insertBefore(s),t.insertAfter(u),t.replace(n)}}}function Kk(){const n=be();if(!ue(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();let t=null;if(kt(e)&&e.getChildrenSize()===0)t=e;else if(Se(e)){const u=e.getParent();kt(u)&&u.getChildren().every(c=>Se(c)&&c.getTextContent().trim()==="")&&(t=u)}if(t===null)return!1;const r=wu(t),i=t.getParent();lt(i)||Or(40);const o=i.getParent();let s;if(un(o))s=Ct(),r.insertAfter(s);else{if(!kt(o))return!1;s=Pn(),o.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const a=t.getNextSiblings();if(a.length>0){const u=bn(i.getListType());if(kt(s)){const c=Pn();c.append(u),s.insertAfter(c)}else s.insertAfter(u);u.append(...a)}return(function(u){let c=u;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const d=c.getParent();if(d==null||!kt(d)&&!lt(d))break;c=d}c.remove()})(t),!0}class vs extends yn{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();lt(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:yn,importDOM:{li:()=>({conversion:Hk,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(s,a,u){const c=a.getParent();!lt(c)||c.getListType()!=="check"||lt(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),u&&a.__checked===u.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(s,a,u){const c=[],d=[],f=a.list,g=f?f.listitem:void 0;let p;if(f&&f.nested&&(p=f.nested.listitem),g!==void 0&&c.push(...jr(g)),f){const v=u.getParent(),m=lt(v)&&v.getListType()==="check",h=u.getChecked();m&&!h||d.push(f.listitemUnchecked),m&&h||d.push(f.listitemChecked),m&&c.push(h?f.listitemChecked:f.listitemUnchecked)}if(p!==void 0){const v=jr(p);u.getChildren().some(m=>lt(m))?c.push(...v):d.push(...v)}d.length>0&&Tc(s,...d),c.length>0&&ar(s,...c)})(t,r.theme,this);const i=e?e.__style:"",o=this.__style;i!==o&&(o===""?t.removeAttribute("style"):t.style.cssText=o),(function(s,a,u){const c=of(a.__textStyle);for(const d in c)s.style.setProperty(`--listitem-marker-${d}`,c[d]);if(u)for(const d in of(u.__textStyle))d in c||s.style.removeProperty(`--listitem-marker-${d}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(oe(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(kt(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!lt(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=bn(r.getListType());let o=this.getNextSibling();for(;o;){const s=o;o=o.getNextSibling(),i.append(s)}r.insertAfter(e),e.insertAfter(i)}return t&&(oe(e)||Or(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(lt(r)||Or(39),kt(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const o=bn(r.getListType());i.forEach(s=>o.append(s)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&qn(t)&&qn(r)&&(Oc(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=Pn().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Ct();this.getChildren().forEach(s=>t.append(s));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),o=kt(i);if(r.getChildrenSize()===1)if(o)r.remove(),i.select();else{r.insertBefore(t),r.remove();const s=e.anchor,a=e.focus,u=t.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(u,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(u,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return lt(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;kt(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Or(117),(e=Math.floor(e))>=0||Or(199);let t=this.getIndent();for(;t!==e;)t<e?(jk(this),t++):(Wk(this),t--);return this}canInsertAfter(e){return kt(e)}canReplaceWith(e){return kt(e)}canMergeWith(e){return kt(e)||lc(e)}extractWithChild(e,t){if(!ue(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return bn("bullet")}canMergeWhenEmpty(){return!0}}function Hk(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return Mf(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Mf(t.children[0])}const e=n.getAttribute("aria-checked");return{node:Pn(e==="true"||e!=="false"&&void 0)}}function Mf(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Pn(n.hasAttribute("checked"))}}function Pn(n){return dn(new vs(void 0,n))}function kt(n){return n instanceof vs}class qa extends yn{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();lt(r)&&t.getListType()===r.getListType()&&Oc(t,r)})(e),yp(e)},extends:yn,importDOM:{ol:()=>({conversion:Of,priority:0}),ul:()=>({conversion:Of,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=Jk[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Pf(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Pf(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ft(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let o=0;o<r.length;o++){const s=r[o];kt(s)||(i===r&&(i=[...r]),i[o]=Pn().append(!oe(s)||lt(s)||s.isInline()?s:Bt(s.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return kt(e)}}function Pf(n,e,t){const r=[],i=[],o=e.list;if(o!==void 0){const s=o[`${t.__tag}Depth`]||[],a=Bk(t)-1,u=a%s.length,c=s[u],d=o[t.__tag];let f;const g=o.nested,p=o.checklist;if(g!==void 0&&g.list&&(f=g.list),d!==void 0&&r.push(d),p!==void 0&&t.__listType==="check"&&r.push(p),c!==void 0){r.push(...jr(c));for(let v=0;v<s.length;v++)v!==u&&i.push(t.__tag+v)}if(f!==void 0){const v=jr(f);a>1?r.push(...v):i.push(...v)}}i.length>0&&Tc(n,...i),r.length>0&&ar(n,...r)}function Vk(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(kt(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(o=>{lt(o)&&e.push(Ef(o))})}else e.push(Ef(r))}return e}function Of(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=bn("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(Ft(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?bn("check"):bn("bullet")),{after:Vk,node:t}}const Jk={ol:"number",ul:"bullet"};function bn(n="number",e=1){return dn(new qa(n,e))}function lt(n){return n instanceof qa}const qk=Le("UPDATE_LIST_START_COMMAND"),xp=Le("INSERT_UNORDERED_LIST_COMMAND"),wp=Le("INSERT_ORDERED_LIST_COMMAND"),Gk=Le("REMOVE_LIST_COMMAND");function Yk(n){return lr(n.registerCommand(wp,()=>(Nf("number"),!0),nn),n.registerCommand(qk,e=>{const{listNodeKey:t,newStart:r}=e,i=St(t);return!!lt(i)&&(i.getListType()==="number"&&(i.setStart(r),yp(i)),!0)},nn),n.registerCommand(xp,()=>(Nf("bullet"),!0),nn),n.registerCommand(Gk,()=>(Uk(),!0),nn),n.registerCommand(Go,()=>Kk(),nn),n.registerNodeTransform(vs,e=>{const t=e.getFirstChild();if(t){if(Se(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=be();ue(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(On,e=>{const t=e.getParent();if(kt(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function Zk(n,e){he(e,!1);const t=fn();_t(()=>Yk(t)),ss(),ve()}function Xk(n,e){return n.getEditorState().read(()=>{const t=St(e);return t===null?!1:t.isSelected()})}function kp(n){n.update(()=>{const e=be();Et(e)&&e.clear()})}function Sp(n,e){const{subscribe:t,set:r}=Pu(!1);return n.registerUpdateListener(()=>{r(Xk(n,e))}),{subscribe:t,set:i=>{n.update(()=>{let o=be();Et(o)||(o=rc(),Zt(o)),Et(o)&&(i?o.add(e):o.delete(e))})}}}var Qk=P('<button type="button" class="image-caption-button">Add Caption</button>'),$k=P('<div><!> <div class="image-resizer image-resizer-n"></div> <div class="image-resizer image-resizer-ne"></div> <div class="image-resizer image-resizer-e"></div> <div class="image-resizer image-resizer-se"></div> <div class="image-resizer image-resizer-s"></div> <div class="image-resizer image-resizer-sw"></div> <div class="image-resizer image-resizer-w"></div> <div class="image-resizer image-resizer-nw"></div></div>');function eS(n,e){he(e,!0);const t=()=>Wi(e.buttonRef,"$buttonRef",r),[r,i]=ya();let o=Q(null);function s(M,j,Y){return Math.min(Math.max(M,j),Y)}const a={east:1,north:8,south:2,west:4},u={priority:"",value:"default"},c={currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0},d=e.editor.getRootElement(),f=e.maxWidth?e.maxWidth:d!==null?d.getBoundingClientRect().width-20:100,g=d!==null?d.getBoundingClientRect().height-20:100,p=100,v=100,m=M=>{const j=M===a.east||M===a.west,Y=M===a.north||M===a.south,Z=M&a.north&&M&a.west||M&a.south&&M&a.east,W=j?"ew":Y?"ns":Z?"nwse":"nesw";d!==null&&d.style.setProperty("cursor",`${W}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${W}-resize`,"important"),u.value=document.body.style.getPropertyValue("-webkit-user-select"),u.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},h=()=>{d!==null&&d.style.setProperty("cursor","default"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",u.value,u.priority))},w=(M,j)=>{if(!e.editor.isEditable())return;const Y=e.imageRef,Z=l(o);if(Y!==null&&Z!==null){M.preventDefault();const{width:W,height:H}=Y.getBoundingClientRect(),ie=uf(Y),I=c;I.startWidth=W,I.startHeight=H,I.ratio=W/H,I.currentWidth=W,I.currentHeight=H,I.startX=M.clientX/ie,I.startY=M.clientY/ie,I.isResizing=!0,I.direction=j,m(j),e.onResizeStart(),Z.classList.add("image-control-wrapper--resizing"),Y.style.height=`${H}px`,Y.style.width=`${W}px`,document.addEventListener("pointermove",b),document.addEventListener("pointerup",x)}},b=M=>{const j=e.imageRef,Y=c,Z=Y.direction&(a.east|a.west),W=Y.direction&(a.south|a.north);if(j!==null&&Y.isResizing){const H=uf(j);if(Z&&W){let ie=Math.floor(Y.startX-M.clientX/H);ie=Y.direction&a.east?-ie:ie;const I=s(Y.startWidth+ie,p,f),F=I/Y.ratio;j.style.width=`${I}px`,j.style.height=`${F}px`,Y.currentHeight=F,Y.currentWidth=I}else if(W){let ie=Math.floor(Y.startY-M.clientY/H);ie=Y.direction&a.south?-ie:ie;const I=s(Y.startHeight+ie,v,g);j.style.height=`${I}px`,Y.currentHeight=I}else{let ie=Math.floor(Y.startX-M.clientX/H);ie=Y.direction&a.east?-ie:ie;const I=s(Y.startWidth+ie,p,f);j.style.width=`${I}px`,Y.currentWidth=I}}},x=()=>{const M=e.imageRef,j=c,Y=l(o);if(M!==null&&Y!==null&&j.isResizing){const Z=j.currentWidth,W=j.currentHeight;j.startWidth=0,j.startHeight=0,j.ratio=0,j.startX=0,j.startY=0,j.currentWidth=0,j.currentHeight=0,j.isResizing=!1,Y.classList.remove("image-control-wrapper--resizing"),h(),e.onResizeEnd(Z,W),document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",x)}};var S=$k(),k=_(S);{var C=M=>{var j=Qk();Mn(j,Y=>Ki(e.buttonRef,Y),()=>t()),ee("click",j,()=>{e.setShowCaption(!e.showCaption)}),y(M,j)};K(k,M=>{!e.showCaption&&e.captionsEnabled&&M(C)})}var N=T(k,2),O=T(N,2),E=T(O,2),D=T(E,2),L=T(D,2),V=T(L,2),G=T(V,2),U=T(G,2);Mn(S,M=>A(o,M),()=>l(o)),ee("pointerdown",N,M=>{w(M,a.north)}),ee("pointerdown",O,M=>{w(M,a.north|a.east)}),ee("pointerdown",E,M=>{w(M,a.east)}),ee("pointerdown",D,M=>{w(M,a.south|a.east)}),ee("pointerdown",L,M=>{w(M,a.south)}),ee("pointerdown",V,M=>{w(M,a.south|a.west)}),ee("pointerdown",G,M=>{w(M,a.west)}),ee("pointerdown",U,M=>{w(M,a.north|a.west)}),y(n,S),ve(),i()}ye(["click","pointerdown"]);function tS(n,e){he(e,!0);let t=se(e,"initialEditor",15),r=se(e,"initialTheme",3,null);function i(c){const d=c.transform();return d!==null?new Set([d]):new Set}bi("editor",t());const o=r()||e.parentEditor._config.theme;o&&t(t()._config.theme=o,!0),t(t()._parentEditor=e.parentEditor,!0);const s=t(t()._nodes=new Map(e.parentEditor._nodes),!0);for(const[c,d]of s)t()._nodes.set(c,{exportDOM:d.exportDOM,klass:d.klass,replace:d.replace,replaceWithKlass:d.replaceWithKlass,sharedNodeState:Bh(d.klass),transforms:i(d.klass)});t(t()._config.namespace=e.parentEditor._config.namespace,!0),t(t()._editable=e.parentEditor._editable,!0),_t(()=>e.parentEditor.registerEditableListener(c=>{t().setEditable(c)}));var a=ne(),u=q(a);It(u,()=>e.children??Nt),y(n,a),ve()}var nS=P("<div></div>");function Cp(n,e){he(e,!0);let t=se(e,"ariaActiveDescendantID",19,()=>{}),r=se(e,"ariaAutoComplete",3,null),i=se(e,"ariaControls",19,()=>{}),o=se(e,"ariaDescribedBy",19,()=>{}),s=se(e,"ariaExpanded",19,()=>{}),a=se(e,"ariaLabel",19,()=>{}),u=se(e,"ariaLabelledBy",19,()=>{}),c=se(e,"ariaMultiline",19,()=>{}),d=se(e,"ariaOwns",19,()=>{}),f=se(e,"ariaRequired",19,()=>{}),g=se(e,"autoCapitalize",19,()=>{}),p=se(e,"className",3,"ContentEditable__root"),v=se(e,"id",19,()=>{}),m=se(e,"role",3,"textbox"),h=se(e,"spellCheck",3,!0),w=se(e,"style",19,()=>{}),b=se(e,"tabIndex",19,()=>{}),x=se(e,"testid",19,()=>{}),S=Q(!1);const k=fn();let C=Q(null);_t(()=>(l(C)&&l(C).ownerDocument&&l(C).ownerDocument.defaultView?k.setRootElement(l(C)):k.setRootElement(null),A(S,k.isEditable(),!0),k.registerEditableListener(O=>{A(S,O,!0)})));var N=nS();Mn(N,O=>A(C,O),()=>l(C)),J(()=>{X(N,"aria-activedescendant",l(S)?t():void 0),X(N,"aria-autocomplete",l(S)?r():"none"),X(N,"aria-controls",l(S)?i():void 0),X(N,"aria-describedby",o()),X(N,"aria-expanded",l(S)&&m()==="combobox"?!!s():void 0),X(N,"aria-label",a()),X(N,"aria-labelledby",u()),X(N,"aria-multiline",c()),X(N,"aria-owns",l(S)?d():null),X(N,"aria-readonly",l(S)?void 0:!0),X(N,"aria-required",f()),X(N,"autocapitalize",g()),Ee(N,1,wt(p())),X(N,"contenteditable",l(S)),X(N,"data-testid",x()),X(N,"id",v()),X(N,"role",m()),X(N,"spellcheck",h()),zn(N,w()),X(N,"tabindex",b())}),y(n,N),ve()}function rS(){return Pt().getTextContent()}function iS(n,e=!0){if(n)return!1;let t=rS();return e&&(t=t.trim()),t===""}function oS(n){if(!iS(n,!1))return!1;const e=Pt().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(ct(i))return!1;if(oe(i)){if(!lc(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let a=0;a<s;a++){const u=o[r];if(!Se(u))return!1}}}return!0}function sS(n){return()=>oS(n)}var aS=P("<div><!></div>");function lS(n,e){he(e,!0);let t=se(e,"className",3,"Placeholder__root");const r=fn();let i=Q(!0);_t(()=>lr(r.registerUpdateListener(()=>{A(i,o(r),!0)}),r.registerEditableListener(()=>{A(i,o(r),!0)})));function o(c){return c.getEditorState().read(sS(c.isComposing()))}var s=ne(),a=q(s);{var u=c=>{var d=aS(),f=_(d);It(f,()=>e.children??Nt),J(()=>Ee(d,1,wt(t()),"svelte-iv58eq")),y(c,d)};K(a,c=>{l(i)&&c(u)})}y(n,s),ve()}var Df=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sl={exports:{}},If;function uS(){return If||(If=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function b(x){return x instanceof u?new u(x.type,b(x.content),x.alias):Array.isArray(x)?x.map(b):x.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(b){return Object.prototype.toString.call(b).slice(8,-1)},objId:function(b){return b.__id||Object.defineProperty(b,"__id",{value:++o}),b.__id},clone:function b(x,S){S=S||{};var k,C;switch(a.util.type(x)){case"Object":if(C=a.util.objId(x),S[C])return S[C];k={},S[C]=k;for(var N in x)x.hasOwnProperty(N)&&(k[N]=b(x[N],S));return k;case"Array":return C=a.util.objId(x),S[C]?S[C]:(k=[],S[C]=k,x.forEach(function(O,E){k[E]=b(O,S)}),k);default:return x}},getLanguage:function(b){for(;b;){var x=i.exec(b.className);if(x)return x[1].toLowerCase();b=b.parentElement}return"none"},setLanguage:function(b,x){b.className=b.className.replace(RegExp(i,"gi"),""),b.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(k){var b=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(k.stack)||[])[1];if(b){var x=document.getElementsByTagName("script");for(var S in x)if(x[S].src==b)return x[S]}return null}},isActive:function(b,x,S){for(var k="no-"+x;b;){var C=b.classList;if(C.contains(x))return!0;if(C.contains(k))return!1;b=b.parentElement}return!!S}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(b,x){var S=a.util.clone(a.languages[b]);for(var k in x)S[k]=x[k];return S},insertBefore:function(b,x,S,k){k=k||a.languages;var C=k[b],N={};for(var O in C)if(C.hasOwnProperty(O)){if(O==x)for(var E in S)S.hasOwnProperty(E)&&(N[E]=S[E]);S.hasOwnProperty(O)||(N[O]=C[O])}var D=k[b];return k[b]=N,a.languages.DFS(a.languages,function(L,V){V===D&&L!=b&&(this[L]=N)}),N},DFS:function b(x,S,k,C){C=C||{};var N=a.util.objId;for(var O in x)if(x.hasOwnProperty(O)){S.call(x,O,x[O],k||O);var E=x[O],D=a.util.type(E);D==="Object"&&!C[N(E)]?(C[N(E)]=!0,b(E,S,null,C)):D==="Array"&&!C[N(E)]&&(C[N(E)]=!0,b(E,S,O,C))}}},plugins:{},highlightAll:function(b,x){a.highlightAllUnder(document,b,x)},highlightAllUnder:function(b,x,S){var k={callback:S,container:b,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",k),k.elements=Array.prototype.slice.apply(k.container.querySelectorAll(k.selector)),a.hooks.run("before-all-elements-highlight",k);for(var C=0,N;N=k.elements[C++];)a.highlightElement(N,x===!0,k.callback)},highlightElement:function(b,x,S){var k=a.util.getLanguage(b),C=a.languages[k];a.util.setLanguage(b,k);var N=b.parentElement;N&&N.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(N,k);var O=b.textContent,E={element:b,language:k,grammar:C,code:O};function D(V){E.highlightedCode=V,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),S&&S.call(E.element)}if(a.hooks.run("before-sanity-check",E),N=E.element.parentElement,N&&N.nodeName.toLowerCase()==="pre"&&!N.hasAttribute("tabindex")&&N.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),S&&S.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){D(a.util.encode(E.code));return}if(x&&r.Worker){var L=new Worker(a.filename);L.onmessage=function(V){D(V.data)},L.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else D(a.highlight(E.code,E.grammar,E.language))},highlight:function(b,x,S){var k={code:b,grammar:x,language:S};if(a.hooks.run("before-tokenize",k),!k.grammar)throw new Error('The language "'+k.language+'" has no grammar.');return k.tokens=a.tokenize(k.code,k.grammar),a.hooks.run("after-tokenize",k),u.stringify(a.util.encode(k.tokens),k.language)},tokenize:function(b,x){var S=x.rest;if(S){for(var k in S)x[k]=S[k];delete x.rest}var C=new f;return g(C,C.head,b),d(b,C,x,C.head,0),v(C)},hooks:{all:{},add:function(b,x){var S=a.hooks.all;S[b]=S[b]||[],S[b].push(x)},run:function(b,x){var S=a.hooks.all[b];if(!(!S||!S.length))for(var k=0,C;C=S[k++];)C(x)}},Token:u};r.Prism=a;function u(b,x,S,k){this.type=b,this.content=x,this.alias=S,this.length=(k||"").length|0}u.stringify=function b(x,S){if(typeof x=="string")return x;if(Array.isArray(x)){var k="";return x.forEach(function(D){k+=b(D,S)}),k}var C={type:x.type,content:b(x.content,S),tag:"span",classes:["token",x.type],attributes:{},language:S},N=x.alias;N&&(Array.isArray(N)?Array.prototype.push.apply(C.classes,N):C.classes.push(N)),a.hooks.run("wrap",C);var O="";for(var E in C.attributes)O+=" "+E+'="'+(C.attributes[E]||"").replace(/"/g,""")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+O+">"+C.content+"</"+C.tag+">"};function c(b,x,S,k){b.lastIndex=x;var C=b.exec(S);if(C&&k&&C[1]){var N=C[1].length;C.index+=N,C[0]=C[0].slice(N)}return C}function d(b,x,S,k,C,N){for(var O in S)if(!(!S.hasOwnProperty(O)||!S[O])){var E=S[O];E=Array.isArray(E)?E:[E];for(var D=0;D<E.length;++D){if(N&&N.cause==O+","+D)return;var L=E[D],V=L.inside,G=!!L.lookbehind,U=!!L.greedy,M=L.alias;if(U&&!L.pattern.global){var j=L.pattern.toString().match(/[imsuy]*$/)[0];L.pattern=RegExp(L.pattern.source,j+"g")}for(var Y=L.pattern||L,Z=k.next,W=C;Z!==x.tail&&!(N&&W>=N.reach);W+=Z.value.length,Z=Z.next){var H=Z.value;if(x.length>b.length)return;if(!(H instanceof u)){var ie=1,I;if(U){if(I=c(Y,W,b,G),!I||I.index>=b.length)break;var re=I.index,F=I.index+I[0].length,R=W;for(R+=Z.value.length;re>=R;)Z=Z.next,R+=Z.value.length;if(R-=Z.value.length,W=R,Z.value instanceof u)continue;for(var B=Z;B!==x.tail&&(R<F||typeof B.value=="string");B=B.next)ie++,R+=B.value.length;ie--,H=b.slice(W,R),I.index-=W}else if(I=c(Y,0,H,G),!I)continue;var re=I.index,le=I[0],ke=H.slice(0,re),Ae=H.slice(re+le.length),we=W+H.length;N&&we>N.reach&&(N.reach=we);var _e=Z.prev;ke&&(_e=g(x,_e,ke),W+=ke.length),p(x,_e,ie);var Ce=new u(O,V?a.tokenize(le,V):le,M,le);if(Z=g(x,_e,Ce),Ae&&g(x,Z,Ae),ie>1){var xe={cause:O+","+D,reach:we};d(b,x,S,Z.prev,W,xe),N&&xe.reach>N.reach&&(N.reach=xe.reach)}}}}}}function f(){var b={value:null,prev:null,next:null},x={value:null,prev:b,next:null};b.next=x,this.head=b,this.tail=x,this.length=0}function g(b,x,S){var k=x.next,C={value:S,prev:x,next:k};return x.next=C,k.prev=C,b.length++,C}function p(b,x,S){for(var k=x.next,C=0;C<S&&k!==b.tail;C++)k=k.next;x.next=k,k.prev=x,b.length-=C}function v(b){for(var x=[],S=b.head.next;S!==b.tail;)x.push(S.value),S=S.next;return x}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(b){var x=JSON.parse(b.data),S=x.language,k=x.code,C=x.immediateClose;r.postMessage(a.highlight(k,a.languages[S],S)),C&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function h(){a.manual||a.highlightAll()}if(!a.manual){var w=document.readyState;w==="loading"||w==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return a})(e);n.exports&&(n.exports=t),typeof Df<"u"&&(Df.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,o){var s={};s["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[o]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+o]={pattern:/[\s\S]+/,inside:t.languages[o]};var u={};u[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var o=r.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(m,h){return"✖ Error "+m+" while fetching file: "+h},o="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",u="loading",c="loaded",d="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+u+'"])';function g(m,h,w){var b=new XMLHttpRequest;b.open("GET",m,!0),b.onreadystatechange=function(){b.readyState==4&&(b.status<400&&b.responseText?h(b.responseText):b.status>=400?w(i(b.status,b.statusText)):w(o))},b.send(null)}function p(m){var h=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(h){var w=Number(h[1]),b=h[2],x=h[3];return b?x?[w,Number(x)]:[w,void 0]:[w,w]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var h=m.element;if(h.matches(f)){m.code="",h.setAttribute(a,u);var w=h.appendChild(document.createElement("CODE"));w.textContent=r;var b=h.getAttribute("data-src"),x=m.language;if(x==="none"){var S=(/\.(\w+)$/.exec(b)||[,"none"])[1];x=s[S]||S}t.util.setLanguage(w,x),t.util.setLanguage(h,x);var k=t.plugins.autoloader;k&&k.loadLanguages(x),g(b,function(C){h.setAttribute(a,c);var N=p(h.getAttribute("data-range"));if(N){var O=C.split(/\r\n?|\n/g),E=N[0],D=N[1]==null?O.length:N[1];E<0&&(E+=O.length),E=Math.max(0,Math.min(E-1,O.length)),D<0&&(D+=O.length),D=Math.max(0,Math.min(D,O.length)),C=O.slice(E,D).join(`
|
|
28
|
-
`),h.hasAttribute("data-start")||h.setAttribute("data-start",String(E+1))}w.textContent=C,t.highlightElement(w)},function(C){h.setAttribute(a,d),w.textContent=C})}}),t.plugins.fileHighlight={highlight:function(h){for(var w=(h||document).querySelectorAll(f),b=0,x;x=w[b++];)t.highlightElement(x)}};var v=!1;t.fileHighlight=function(){v||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),v=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Sl)),Sl.exports}uS();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",o)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(d){return d=d.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(d){["url","bold","italic","strike","code-snippet"].forEach(function(f){d!==f&&(n.languages.markdown[d].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(d){if(d.language!=="markdown"&&d.language!=="md")return;function f(g){if(!(!g||typeof g=="string"))for(var p=0,v=g.length;p<v;p++){var m=g[p];if(m.type!=="code"){f(m.content);continue}var h=m.content[1],w=m.content[3];if(h&&w&&h.type==="code-language"&&w.type==="code-block"&&typeof h.content=="string"){var b=h.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");b=(/[a-z][\w-]*/i.exec(b)||[""])[0].toLowerCase();var x="language-"+b;w.alias?typeof w.alias=="string"?w.alias=[w.alias,x]:w.alias.push(x):w.alias=[x]}}}f(d.tokens)}),n.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var f="",g=0,p=d.classes.length;g<p;g++){var v=d.classes[g],m=/language-(.+)/.exec(v);if(m){f=m[1];break}}var h=n.languages[f];if(h)d.content=n.highlight(c(d.content),h,f);else if(f&&f!=="none"&&n.plugins.autoloader){var w="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);d.attributes.id=w,n.plugins.autoloader.loadLanguages(f,function(){var b=document.getElementById(w);b&&(b.innerHTML=n.highlight(b.textContent,n.languages[f],f))})}}});var s=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;function c(d){var f=d.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,p){if(p=p.toLowerCase(),p[0]==="#"){var v;return p[1]==="x"?v=parseInt(p.slice(2),16):v=Number(p.slice(1)),u(v)}else{var m=a[p];return m||g}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var Ff={},Lf;function cS(){return Lf||(Lf=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Ff}cS();var Rf={},zf;function dS(){return zf||(zf=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Rf}dS();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var Bf={},Uf;function fS(){return Uf||(Uf=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),Bf}fS();var jf={},Wf;function gS(){return Wf||(Wf=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),jf}gS();var Kf={},Hf;function hS(){return Hf||(Hf=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Kf}hS();function Tp(n,e){for(const t of n.childNodes){if(Ft(t)&&t.tagName===e)return!0;Tp(t,e)}return!1}const Po="data-language",Eo="data-highlight-language",Ls="data-theme";class ps extends yn{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new ps(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");ar(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Po,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Eo,r));const i=this.getTheme();i&&t.setAttribute(Ls,i);const o=this.getStyle();return o&&t.setAttribute("style",o),t}updateDOM(e,t,r){const i=this.__language,o=e.__language;i?i!==o&&t.setAttribute(Po,i):o&&t.removeAttribute(Po);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&o?s&&i?i!==o&&t.setAttribute(Eo,i):t.removeAttribute(Eo):s&&i&&t.setAttribute(Eo,i);const a=this.__theme,u=e.__theme;a?a!==u&&t.setAttribute(Ls,a):u&&t.removeAttribute(Ls);const c=this.__style,d=e.__style;return c?c!==d&&t.setAttribute("style",c):d&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");ar(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Po,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Eo,r));const i=this.getTheme();i&&t.setAttribute(Ls,i);const o=this.getStyle();return o&&t.setAttribute("style",o),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Tp(e,"BR"))?{conversion:Vf,priority:1}:null,div:()=>({conversion:pS,priority:1}),pre:()=>({conversion:Vf,priority:0}),table:e=>Cl(e)?{conversion:mS,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&Cl(r)?{conversion:Jf,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&Cl(t)?{conversion:Jf,priority:3}:null}}}static importJSON(e){return mi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
29
|
-
`&&r[i-2].getTextContent()===`
|
|
30
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const u=Ct();return this.insertAfter(u,t),u}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if(Se(a)){let u=bS(a);const c=[];for(;;)if(La(u))c.push(_o()),u=u.getNextSibling();else{if(!Np(u))break;{let h=0;const w=u.getTextContent(),b=u.getTextContentSize();for(;h<b&&w[h]===" ";)h++;if(h!==0&&c.push(Ep(" ".repeat(h))),h!==b)break;u=u.getNextSibling()}}const d=a.splitText(o.offset)[0],f=o.offset===0?0:1,g=d.getIndexWithinParent()+f,p=a.getParentOrThrow(),v=[Sr(),...c];p.splice(g,0,v);const m=c[c.length-1];m?m.select():o.offset===0?d.selectPrevious():d.getNextSibling().selectNext(0,0)}if(vS(a)){const{offset:u}=e.anchor;a.splice(u,0,[Sr()]),a.select(u+1,u+1)}return null}canIndent(){return!1}collapseAtStart(){const e=Ct();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function mi(n,e){return A2(ps).setLanguage(n).setTheme(e)}function vS(n){return n instanceof ps}function Vf(n){return{node:mi(n.getAttribute(Po))}}function pS(n){const e=n,t=qf(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(qf(i))return!0;i=i.parentElement}return!1})(e)?{node:t?mi():null}:{node:null}}function mS(){return{node:mi()}}function Jf(){return{node:null}}function qf(n){return n.style.fontFamily.match("monospace")!==null}function Cl(n){return n.classList.contains("js-file-line-container")}class ms extends On{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new ms(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=Tl(e.theme,this.__highlightType);return ar(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),o=Tl(r.theme,e.__highlightType),s=Tl(r.theme,this.__highlightType);return o!==s&&(o&&Tc(t,o),s&&ar(t,s)),i}static importJSON(e){return Ep().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return mi()}}function Tl(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function Ep(n="",e){return dn(new ms(n,e))}function Np(n){return n instanceof ms}function _S(n,e){let t=n;for(let r=Gt(n,e);r&&(Np(r.origin)||La(r.origin));r=Z2(r))t=r.origin;return t}function bS(n){return _S(n,"previous")}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
31
|
-
?|
|
|
32
|
-
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);class Ap extends Si{__format;constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){const t=this.getWritable();return t.__format=e,t}isInline(){return!1}}function Gf(n){return n instanceof Ap}const yS=new Set(["http:","https:","mailto:","sms:","tel:"]);class Hr extends yn{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Hr(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),ar(t,e.theme.link),t}updateLinkDOM(e,t,r){if(Wv(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const o=`__${i}`,s=this[o];e&&e[o]===s||(s?t[i]=s:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:xS,priority:1})}}static importJSON(e){return Xi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Qf(e);try{const t=new URL(Qf(e));if(!yS.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=Xi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!ue(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function xS(n){let e=null;if(Wv(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=Xi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function Xi(n="",e){return dn(new Hr(n,e))}function qr(n){return n instanceof Hr}class _s extends Hr{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new _s(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Yf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(oe(r)){const i=Yf(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function Yf(n="",e){return dn(new _s(n,e))}function Rs(n){return n instanceof _s}const Zf=Le("TOGGLE_LINK_COMMAND");function Xf(n,e){if(n.type==="element"){const t=n.getNode();return oe(t)||(function(r,...i){const o=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",r);for(const a of i)s.append("v",a);throw o.search=s.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function El(n,e={}){let t;if(n&&typeof n=="object"){const{url:d,...f}=n;t=d,e={...f,...e}}else t=n;const{target:r,title:i}=e,o=e.rel===void 0?"noreferrer":e.rel,s=be();if(s===null||!ue(s)&&!Et(s))return;if(Et(s)){const d=s.getNodes();return d.length===0?void 0:void d.forEach(f=>{if(t===null){const g=rn(f,p=>!Rs(p)&&qr(p));g&&(g.insertBefore(f),g.getChildren().length===0&&g.remove())}else{const g=rn(f,p=>!Rs(p)&&qr(p));if(g)g.setURL(t),r!==void 0&&g.setTarget(r),o!==void 0&&g.setRel(o);else{const p=Xi(t,{rel:o,target:r});f.insertBefore(p),p.append(f)}}})}const a=s.extract();if(t===null){const d=new Set;return void a.forEach(f=>{const g=rn(f,p=>!Rs(p)&&qr(p));if(g!==null){const p=g.getKey();if(d.has(p))return;(function(v,m){const h=new Set(m.filter(O=>v.isParentOf(O)).map(O=>O.getKey())),w=v.getChildren(),b=O=>h.has(O.getKey())||oe(O)&&m.some(E=>v.isParentOf(E)&&O.isParentOf(E)),x=w.filter(b);if(x.length===w.length)return w.forEach(O=>v.insertBefore(O)),void v.remove();const S=w.findIndex(b),k=w.findLastIndex(b),C=S===0,N=k===w.length-1;if(C)x.forEach(O=>v.insertBefore(O));else if(N)for(let O=x.length-1;O>=0;O--)v.insertAfter(x[O]);else{for(let E=x.length-1;E>=0;E--)v.insertAfter(x[E]);const O=w.slice(k+1);if(O.length>0){const E=Xi(v.getURL(),{rel:v.getRel(),target:v.getTarget(),title:v.getTitle()});x[x.length-1].insertAfter(E),O.forEach(D=>E.append(D))}}})(g,a),d.add(p)}})}const u=new Set,c=d=>{u.has(d.getKey())||(u.add(d.getKey()),d.setURL(t),r!==void 0&&d.setTarget(r),o!==void 0&&d.setRel(o),i!==void 0&&d.setTitle(i))};if(a.length===1){const d=a[0],f=rn(d,qr);if(f!==null)return c(f)}(function(d){const f=be();if(!ue(f))return d();const g=ro(f),p=g.isBackward(),v=Xf(g.anchor,p?-1:0),m=Xf(g.focus,p?0:-1);if(d(),v||m){const h=be();if(ue(h)){const w=h.clone();if(v){const b=v.getParent();b&&w.anchor.set(b.getKey(),v.getIndexWithinParent()+(p?1:0),"element")}if(m){const b=m.getParent();b&&w.focus.set(b.getKey(),m.getIndexWithinParent()+(p?0:1),"element")}Zt(ro(w))}}})(()=>{let d=null;for(const f of a){if(!f.isAttached())continue;const g=rn(f,qr);if(g){c(g);continue}if(oe(f)){if(!f.isInline())continue;if(qr(f)){if(!(Rs(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){c(f),d=f;continue}for(const v of f.getChildren())f.insertBefore(v);f.remove();continue}}const p=f.getPreviousSibling();qr(p)&&p.is(d)?p.append(f):(d=Xi(t,{rel:o,target:r,title:i}),f.insertAfter(d),d.append(f))}})}const wS=/^\+?[0-9\s()-]{5,}$/;function Qf(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:wS.test(n)?`tel:${n}`:`https://${n}`}var kS=P("<div><!></div>");function SS(n,e){he(e,!0);const t=()=>Wi(s,"$isSelected",r),[r,i]=ya(),o=fn();let s=Sp(o,e.nodeKey),a;gt(()=>lr(o.registerCommand(ov,d=>{if(t()){const f=be();if(Et(f)){const g=St(e.nodeKey);Gf(g)&&g.setFormat(d)}else if(ue(f)){const g=f.getNodes();for(const p of g)Gf(p)?p.setFormat(d):ip(p).setFormat(d)}return!0}return!1},nn),o.registerCommand(Pa,d=>d.target===a?(d.preventDefault(),d.shiftKey||kp(o),Ki(s,!t()),!0):!1,nn)));var u=kS(),c=_(u);It(c,()=>e.children),Mn(u,d=>a=d,()=>a),J(d=>{Ee(u,1,d),zn(u,`text-align: ${e.format?e.format:""};`)},[()=>wt([e.className.base,t()?e.className.focus:null].filter(Boolean).join(" "))]),y(n,u),ve(),i()}var CS=P('<iframe width="560" height="315" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" title="YouTube video"></iframe>');function TS(n,e){SS(n,{get className(){return e.className},get format(){return e.format},get nodeKey(){return e.nodeKey},children:(t,r)=>{var i=CS();i.allowFullscreen=!0,J(()=>X(i,"src",`https://www.youtube-nocookie.com/embed/${e.videoID}`)),y(t,i)},$$slots:{default:!0}})}function ES(n){const e=n.getAttribute("data-lexical-youtube");return e?{node:Dc(e)}:null}class Ga extends Ap{__id;static getType(){return"youtube"}static clone(e){return new Ga(e.__id,e.__format,e.__key)}static importJSON(e){return Dc(e.videoID).updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),videoID:this.__id}}constructor(e,t,r){super(t,r),this.__id=e}exportDOM(){const e=document.createElement("iframe");return e.setAttribute("data-lexical-youtube",this.__id),e.setAttribute("width","560"),e.setAttribute("height","315"),e.setAttribute("src",`https://www.youtube-nocookie.com/embed/${this.__id}`),e.setAttribute("frameborder","0"),e.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),e.setAttribute("allowfullscreen","true"),e.setAttribute("title","YouTube video"),{element:e}}static importDOM(){return{iframe:e=>e.hasAttribute("data-lexical-youtube")?{conversion:ES,priority:1}:null}}updateDOM(){return!1}getId(){return this.__id}getTextContent(e,t){return`https://www.youtube.com/watch?v=${this.__id}`}decorate(e,t){const r=t.theme.embedBlock||{},i={base:r.base||"",focus:r.focus||""};return{componentClass:TS,updateProps:o=>{o.className=i,o.format=this.__format,o.nodeKey=this.__key,o.videoID=this.__id}}}}function Dc(n){return new Ga(n)}const Mp=n=>{n.update(()=>{const e=be();ue(e)&&Ka(e,()=>Ct())})},Nl=(n,e,t)=>{e!==t&&n.update(()=>{const r=be();Ka(r,()=>ji(t))})},NS=(n,e)=>{e!=="bullet"?n.dispatchCommand(xp,void 0):Mp(n)},AS=(n,e)=>{e!=="number"?n.dispatchCommand(wp,void 0):Mp(n)},MS=(n,e)=>{e!=="quote"&&n.update(()=>{const t=be();Ka(t,()=>Mc())})},PS=(n,e)=>{e!=="code"&&n.update(()=>{let t=be();if(t)if(!ue(t)||t.isCollapsed())Ka(t,()=>mi());else{const r=t.getTextContent(),i=mi();t.insertNodes([i]),t=be(),ue(t)&&t.insertRawText(r)}})};function OS(n){n.dispatchCommand(kn,"bold")}function DS(n){n.dispatchCommand(kn,"italic")}function IS(n){n.dispatchCommand(kn,"strikethrough")}function FS(n){n.dispatchCommand(kn,"underline")}function LS(n){n.dispatchCommand(Da,void 0)}function RS(n){n.dispatchCommand(Ia,void 0)}function zS(n,e=void 0){n.focus(()=>{const t=document.activeElement,r=n.getRootElement();r!==null&&(t===null||!r.contains(t))&&r.focus({preventScroll:!0})},{defaultSelection:e})}function Pp(n,e){he(e,!1);const t=fn();_t(()=>{zS(t)}),ss(),ve()}const $f=new Set,eg=Le("RIGHT_CLICK_IMAGE_COMMAND");var BS=P('<img draggable="false"/>'),US=P('<img src="/images/image-broken.svg" alt="broken link" style="height: 200px; width: 200px; opacity: 0.2;" draggable="false"/>'),jS=P("<p>...loading image</p>"),WS=P("<!> <!> <!> <!> <!>",1),KS=P('<div class="image-caption-container"><!></div>'),HS=P("<div><!></div> <!> <!>",1);function VS(n,e){he(e,!0);const t=()=>Wi(d,"$isSelected",o),r=()=>Wi(p,"$isEditable",o),i=()=>Wi(c,"$buttonRef",o),[o,s]=ya();let a=Q(null),u=Q(null),c=Pu(null),d=Sp(e.editor,e.nodeKey),f=Q(!1),g,p=xk(),v=z(()=>t()&&Et(l(a))&&!l(f)),m=z(()=>(t()||l(f))&&r()),h=new Promise((I,F)=>{if($f.has(e.src))I(null);else{const R=new Image;R.src=e.src,R.onload=()=>{$f.add(e.src),I(null)},R.onerror=()=>{F(null)}}});const w=I=>{const F=be(),R=i();if(t()&&Et(F)&&F.getNodes().length===1){if(e.showCaption)return A(a,null),I.preventDefault(),e.caption.focus(),!0;if(R!==null&&R!==document.activeElement)return I.preventDefault(),R.focus(),!0}return!1},b=I=>g===e.caption||i()===I.target?(A(a,null),e.editor.update(()=>{Ki(d,!0);const F=e.editor.getRootElement();F!==null&&F.focus()}),!0):!1,x=I=>{const F=I;return l(f)?!0:F.target===l(u)?(F.shiftKey?Ki(d,!t()):(kp(e.editor),Ki(d,!0)),!0):!1},S=I=>{e.editor.getEditorState().read(()=>{const F=be();I.target.tagName==="IMG"&&ue(F)&&F.getNodes().length===1&&e.editor.dispatchCommand(eg,I)})};_t(()=>{const I=e.editor.getRootElement(),F=lr(e.editor.registerUpdateListener(({editorState:R})=>{const B=R.read(()=>be());Et(B)?A(a,B,!0):A(a,null)}),e.editor.registerCommand(Ma,(R,B)=>(g=B,!1),nn),e.editor.registerCommand(Pa,x,nn),e.editor.registerCommand(eg,x,nn),e.editor.registerCommand($u,R=>R.target===l(u)?(R.preventDefault(),!0):!1,nn),e.editor.registerCommand(Xo,w,nn),e.editor.registerCommand(Qu,b,nn));return I?.addEventListener("contextmenu",S),()=>{F(),I?.removeEventListener("contextmenu",S)}});const k=()=>{e.editor.update(()=>{const I=St(e.nodeKey);tg(I)&&I.setShowCaption(!0)})},C=(I,F)=>{setTimeout(()=>{A(f,!1)},200),e.editor.update(()=>{const R=St(e.nodeKey);tg(R)&&R.setWidthAndHeight(I,F)})},N=()=>{A(f,!0)},O=Ck();let E=Q(null);function D(I){return I.toLowerCase().endsWith(".svg")}const L=D(e.src);gt(()=>{if(l(u)&&L){const{naturalWidth:I,naturalHeight:F}=l(u);A(E,{height:F,width:I},!0)}});function V(){if(!L)return{height:e.height,maxWidth:e.maxWidth,width:e.width};const I=l(E)?.width||200,F=l(E)?.height||200;let R=I,B=F;if(R>e.maxWidth){const le=e.maxWidth/R;R=e.maxWidth,B=Math.round(B*le)}const re=500;if(B>re){const le=re/B;B=re,R=Math.round(R*le)}return{height:B,maxWidth:e.maxWidth,width:R}}const G=z(V);var U=HS(),M=q(U),j=_(M);y_(j,()=>h,I=>{var F=jS();y(I,F)},(I,F)=>{var R=BS();let B;Mn(R,re=>A(u,re),()=>l(u)),J(re=>{X(R,"src",e.src),X(R,"alt",e.altText),zn(R,`height:${l(G).height==="inherit"?"inherit":l(G).height+"px"};max-width:${e.maxWidth??""}px;width:${l(G).width==="inherit"?"inherit":l(G).width+"px"};`),B=Ee(R,1,"",null,B,re)},[()=>({focused:l(m),draggable:l(m)&&Et(l(a))})]),cn("load",R,re=>{if(L){const le=re.currentTarget;A(E,{height:le.naturalHeight,width:le.naturalWidth},!0)}}),y(I,R)},(I,F)=>{var R=US();y(I,R)});var Y=T(M,2);{var Z=I=>{var F=KS(),R=_(F);tS(R,{get initialEditor(){return e.caption},get parentEditor(){return e.editor},children:(B,re)=>{var le=WS(),ke=q(le);Pp(ke,{});var Ae=T(ke,2);Qt(Ae,()=>O.componentType,(xe,Fe)=>{Fe(xe,Me(()=>O.props))});var we=T(Ae,2);pp(we,{});var _e=T(we,2);Cp(_e,{className:"ImageNode__contentEditable"});var Ce=T(_e,2);lS(Ce,{className:"ImageNode__placeholder",children:(xe,Fe)=>{var ge=ai("Enter image caption...");y(xe,ge)},$$slots:{default:!0}}),y(B,le)},$$slots:{default:!0}}),y(I,F)};K(Y,I=>{e.showCaption&&I(Z)})}var W=T(Y,2);{var H=I=>{eS(I,{get showCaption(){return e.showCaption},setShowCaption:k,get editor(){return e.editor},get buttonRef(){return c},get imageRef(){return l(u)},get maxWidth(){return e.maxWidth},onResizeStart:N,onResizeEnd:C,get captionsEnabled(){return e.captionsEnabled}})},ie=z(()=>e.resizable&&Et(l(a))&&l(m));K(W,I=>{l(ie)&&I(H)})}J(()=>X(M,"draggable",l(v))),y(n,U),ve(),s()}class Ya extends On{static getType(){return"hashtag"}static clone(e){return new Ya(e.__text,e.__key)}createDOM(e){const t=super.createDOM(e);return ar(t,e.theme.hashtag),t}static importJSON(e){return JS().updateFromJSON(e)}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function JS(n=""){return dn(new Ya(n))}class Za extends On{static getType(){return"keyword"}static clone(e){return new Za(e.__text,e.__key)}static importJSON(e){return qS().updateFromJSON(e)}createDOM(e){const t=super.createDOM(e);return t.style.cursor="default",t.className="keyword",t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}isTextEntity(){return!0}}function qS(n=""){return dn(new Za(n))}function GS(n){return n.parentElement!=null&&n.parentElement.tagName==="LI"&&n.previousSibling===null&&n.getAttribute("aria-roledescription")==="checkbox"}function YS(n){const e=n;if(e.src.startsWith("file:///")||GS(e))return null;const{alt:t,src:r,width:i,height:o}=e;return{node:ma({altText:t,height:o,src:r,width:i})}}class bs extends Si{__src;__altText;__width;__height;__maxWidth;__showCaption;__caption;__captionsEnabled;static getType(){return"image"}static clone(e){return new bs(e.__src,e.__altText,e.__maxWidth,e.__width,e.__height,e.__showCaption,e.__caption,e.__captionsEnabled,e.__key)}static importJSON(e){const{altText:t,height:r,width:i,maxWidth:o,src:s,showCaption:a}=e;return ma({altText:t,height:r,maxWidth:o,showCaption:a,src:s,width:i}).updateFromJSON(e)}updateFromJSON(e){const t=super.updateFromJSON(e),{caption:r}=e,i=t.__caption,o=i.parseEditorState(r.editorState);return o.isEmpty()||i.setEditorState(o),t}exportDOM(){const e=document.createElement("img");return e.setAttribute("src",this.__src),e.setAttribute("alt",this.__altText),e.setAttribute("width",this.__width.toString()),e.setAttribute("height",this.__height.toString()),{element:e}}static importDOM(){return{img:e=>({conversion:YS,priority:0})}}constructor(e,t,r,i,o,s,a,u,c){super(c),this.__src=e,this.__altText=t,this.__maxWidth=r,this.__width=i||"inherit",this.__height=o||"inherit",this.__showCaption=s||!1,this.__caption=a||uc({namespace:"Playground/ImageNodeCaption",nodes:[Ci,On,wi,Ti,Hr,Ya,Za]}),this.__captionsEnabled=u||u===void 0}exportJSON(){return{...super.exportJSON(),altText:this.getAltText(),caption:this.__caption.toJSON(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,showCaption:this.__showCaption,src:this.getSrc(),width:this.__width==="inherit"?0:this.__width}}setWidthAndHeight(e,t){const r=this.getWritable();r.__width=e,r.__height=t}setShowCaption(e){const t=this.getWritable();t.__showCaption=e}createDOM(e){const t=document.createElement("span"),i=e.theme.image;return i!==void 0&&(t.className=i),t}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}decorate(e,t){return{componentClass:VS,updateProps:r=>{r.src=this.__src,r.altText=this.__altText,r.width=this.__width,r.height=this.__height,r.maxWidth=this.__maxWidth,r.nodeKey=this.__key,r.showCaption=this.__showCaption,r.caption=this.__caption,r.captionsEnabled=this.__captionsEnabled,r.resizable=!0,r.editor=e}}}}function ma({altText:n,height:e,maxWidth:t=500,captionsEnabled:r,src:i,width:o,showCaption:s,caption:a,key:u}){return dn(new bs(i,n,t,o,e,s,a,r,u))}function tg(n){return n instanceof bs}const ng=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],rg=ng[Math.floor(Math.random()*ng.length)];rg[1],rg[0];function ZS(n,e){he(e,!0);let t=se(e,"validateUrl",19,()=>{}),r=se(e,"attributes",19,()=>({}));const i=fn();_t(()=>{if(!i.hasNodes([Hr]))throw new Error("LinkPlugin: LinkNode not registered on editor");return lr(i.registerCommand(Zf,o=>{if(o===null)return El(o),!0;if(typeof o=="string")return t()===void 0||t()(o)?(El(o,r()),!0):!1;{const{url:s,target:a,rel:u,title:c}=o;return El(s,{...r(),rel:u,target:a,title:c}),!0}},nn),t()!==void 0?i.registerCommand(Oa,o=>{const s=be();if(!ue(s)||s.isCollapsed()||!Pr(o,ClipboardEvent)||o.clipboardData===null)return!1;const a=o.clipboardData.getData("text");return t()(a)?s.getNodes().some(u=>oe(u))?!1:(i.dispatchCommand(Zf,a),o.preventDefault(),!0):!1},nn):()=>{})}),ve()}ye(["keydown","mousedown","click"]);ye(["click"]);ye(["click"]);ye(["keydown"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["mousedown"]);ye(["change"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["pointerdown"]);function XS(n,e){he(e,!0);let t=se(e,"ignoreHistoryMergeTagChange",3,!0),r=se(e,"ignoreSelectionChange",3,!1);const i=fn();_t(()=>{e.onChange&&i.registerUpdateListener(({editorState:o,dirtyElements:s,dirtyLeaves:a,prevEditorState:u,tags:c})=>{r()&&s.size===0&&a.size===0||t()&&c.has(ri)||u.isEmpty()||e.onChange(o,i,c)})}),ve()}ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click","keydown"]);ye(["click"]);ye(["change"]);ye(["click"]);ye(["click"]);ye(["change"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click"]);ye(["click","change"]);const zs={tag:ri};function QS(n,e){if(e!==null){if(e===void 0)n.update(()=>{const t=Pt();if(t.isEmpty()){const r=Ct();t.append(r);const i=np?document.activeElement:null;(be()!==null||i!==null&&i===n.getRootElement())&&r.select()}},zs);else if(e!==null)switch(typeof e){case"string":{const t=n.parseEditorState(e);n.setEditorState(t,zs);break}case"object":{n.setEditorState(e,zs);break}case"function":{n.update(()=>{Pt().isEmpty()&&e(n)},zs);break}}}}function $S(n){n.extensions={}}function eC(n,e){he(e,!0);const t=()=>Wi(p,"$isEditable",r),[r,i]=ya(),{theme:o,namespace:s,nodes:a,onError:u,editorState:c,editable:d,html:f}=e.initialConfig,g=uc({editable:d,html:f,namespace:s,nodes:a,onError:x=>u(x,g),theme:o});QS(g,c),$S(g),yk(g);const p=Pu(d!==void 0?d:!0);bi("isEditable",p),_t(()=>(g.setEditable(t()),g.registerEditableListener(x=>{Ki(p,x)}))),wk(Pc()),kk();function v(){return g}var m={getEditor:v},h=ne(),w=q(h);It(w,()=>e.children??Nt),y(n,h);var b=ve(m);return i(),b}var tC=P('<div class="border rounded p-2 bg-background min-h-[60px]"></div>'),nC=P('<textarea class="w-full min-h-[80px] font-mono text-sm bg-muted/30 rounded p-2 border-none resize-y focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Enter HTML code..." spellcheck="false"></textarea>'),rC=P('<div class="border border-dashed border-muted-foreground/50 rounded p-3 my-2"><div class="flex items-center justify-between mb-2"><span class="text-xs font-medium text-muted-foreground uppercase tracking-wider">Custom HTML</span> <button type="button" class="text-xs px-2 py-0.5 rounded bg-muted hover:bg-accent"> </button></div> <!></div>');function iC(n,e){he(e,!0);let t=se(e,"html",3,""),r=se(e,"nodeKey",3,""),i=Q(!1),o=Q(We(t()));const s=fn();function a(){s.update(()=>{const h=St(r());sC(h)&&h.setHtml(l(o))})}function u(){a()}var c=rC(),d=_(c),f=T(_(d),2),g=_(f),p=T(d,2);{var v=h=>{var w=tC();Wl(w,t,!0),y(h,w)},m=h=>{var w=nC();ee("input",w,u),Mt(w,()=>l(o),b=>A(o,b)),y(h,w)};K(p,h=>{l(i)?h(v):h(m,-1)})}J(()=>$(g,l(i)?"Edit":"Preview")),ee("click",f,()=>A(i,!l(i))),y(n,c),ve()}ye(["click","input"]);class uo extends Si{__html;static getType(){return"custom-html"}static clone(e){return new uo(e.__html,e.__key)}constructor(e,t){super(t),this.__html=e}createDOM(e){const t=document.createElement("div");return t.className="lexical-custom-html",t.setAttribute("contenteditable","false"),t}updateDOM(){return!1}static importJSON(e){return new uo(e.html)}exportJSON(){return{...super.exportJSON(),type:"custom-html",version:1,html:this.__html}}decorate(e,t){return{componentClass:iC,updateProps:r=>{r.html=this.__html,r.nodeKey=this.__key}}}isInline(){return!1}getHtml(){return this.__html}setHtml(e){const t=this.getWritable();return t.__html=e,t}}function oC(n){return new uo(n)}function sC(n){return n instanceof uo}var aC=P('<textarea class="w-full bg-transparent italic text-lg resize-none focus:outline-none border-none p-0" rows="2" placeholder="Enter quote text..."></textarea> <input class="w-full bg-transparent text-sm text-muted-foreground mt-2 focus:outline-none border-none p-0" placeholder="Attribution (optional)"/>',1),lC=P('<cite class="block mt-2 text-sm text-muted-foreground not-italic"> </cite>'),uC=P('<blockquote class="italic text-lg"> </blockquote> <!>',1),cC=P('<div class="border-l-4 border-primary pl-4 py-2 my-2 bg-muted/20 rounded-r cursor-pointer"><!></div>');function dC(n,e){he(e,!0);let t=se(e,"text",3,""),r=se(e,"attribution",3,""),i=se(e,"nodeKey",3,""),o=Q(!1),s=Q(We(t())),a=Q(We(r()));const u=fn();function c(){A(s,t()),A(a,r()),A(o,!0)}function d(){A(o,!1),u.update(()=>{const h=St(i());gC(h)&&(h.setText(l(s)),h.setAttribution(l(a)))})}function f(h){h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),d()),h.key==="Escape"&&A(o,!1)}var g=cC(),p=_(g);{var v=h=>{var w=aC(),b=q(w),x=T(b,2);cn("blur",b,d),ee("keydown",b,f),Mt(b,()=>l(s),S=>A(s,S)),cn("blur",x,d),ee("keydown",x,f),Mt(x,()=>l(a),S=>A(a,S)),y(h,w)},m=h=>{var w=uC(),b=q(w),x=_(b),S=T(b,2);{var k=C=>{var N=lC(),O=_(N);J(()=>$(O,`-- ${r()??""}`)),y(C,N)};K(S,C=>{r()&&C(k)})}J(()=>$(x,t()||"Click to add quote text...")),y(h,w)};K(p,h=>{l(o)?h(v):h(m,-1)})}ee("click",g,c),y(n,g),ve()}ye(["click","keydown"]);class co extends Si{__text;__attribution;static getType(){return"pull-quote"}static clone(e){return new co(e.__text,e.__attribution,e.__key)}constructor(e,t,r){super(r),this.__text=e,this.__attribution=t}createDOM(e){const t=document.createElement("div");return t.className="lexical-pull-quote",t.setAttribute("contenteditable","false"),t}updateDOM(){return!1}static importJSON(e){return new co(e.text,e.attribution)}exportJSON(){return{...super.exportJSON(),type:"pull-quote",version:1,text:this.__text,attribution:this.__attribution}}decorate(e,t){return{componentClass:dC,updateProps:r=>{r.text=this.__text,r.attribution=this.__attribution,r.nodeKey=this.__key}}}isInline(){return!1}getText(){return this.__text}getAttribution(){return this.__attribution}setText(e){const t=this.getWritable();return t.__text=e,t}setAttribution(e){const t=this.getWritable();return t.__attribution=e,t}}function fC(n,e){return new co(n,e)}function gC(n){return n instanceof co}const hC=[co,uo];function Op(n){const e=new FormData;return e.append("file",n),_h("/upload/media",e)}function Dp(n,e,t={}){const r=new FormData;r.append("file",e);for(const[i,o]of Object.entries(t.extra??{}))r.append(i,o);return _h(`/upload/${encodeURIComponent(n)}`,r)}var vC=P('<button type="button"><!> </button>'),pC=P('<div class="w-48 shrink-0 overflow-y-auto border-r p-2"><button type="button"><!> All Media</button> <!></div>'),mC=P('<div class="flex h-full items-center justify-center"><p class="text-sm text-muted-foreground">Loading...</p></div>'),_C=P('<div class="flex h-full flex-col items-center justify-center gap-2"><p class="text-sm text-muted-foreground">No media found</p> <button type="button" class="inline-flex h-9 items-center gap-2 rounded-md border px-3 text-sm hover:bg-accent"><!> Upload a file</button></div>'),bC=P('<img class="h-full w-full object-cover group-hover:scale-105 transition-transform"/>'),yC=P('<div class="flex h-full w-full items-center justify-center"><!></div>'),xC=P('<button type="button" class="group flex flex-col overflow-hidden rounded-md border hover:border-primary hover:shadow-sm transition-all"><div class="aspect-square w-full overflow-hidden bg-muted"><!></div> <div class="p-2"><p class="truncate text-xs font-medium"> </p> <p class="text-xs text-muted-foreground"> </p></div></button>'),wC=P('<div class="grid grid-cols-2 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"></div>'),kC=P('<div class="flex items-center justify-between border-t px-4 py-2"><p class="text-xs text-muted-foreground"> </p> <div class="flex items-center gap-2"><button type="button" class="rounded-md border px-3 py-1 text-sm hover:bg-accent disabled:opacity-50">Previous</button> <span class="text-sm"> </span> <button type="button" class="rounded-md border px-3 py-1 text-sm hover:bg-accent disabled:opacity-50">Next</button></div></div>'),SC=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4"><div class="flex h-[85vh] w-full max-w-5xl flex-col rounded-lg border bg-background shadow-xl"><div class="flex items-center justify-between border-b px-4 py-3"><h2 class="text-lg font-semibold">Media Library</h2> <div class="flex items-center gap-2"><button type="button" class="inline-flex h-9 items-center gap-2 rounded-md bg-primary px-3 text-sm text-primary-foreground hover:bg-primary/90 disabled:opacity-50"><!> </button> <button type="button" class="rounded p-1.5 hover:bg-accent"><!></button></div></div> <div class="border-b px-4 py-2"><div class="relative"><!> <input type="text" placeholder="Search media..." class="h-9 w-full rounded-md border bg-background pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary"/></div></div> <div class="flex flex-1 overflow-hidden"><!> <div class="flex-1 overflow-y-auto p-4"><!></div></div> <!></div></div> <input type="file" class="hidden"/>',1);function Ip(n,e){he(e,!0);let t=se(e,"open",15,!1),r=se(e,"accept",19,()=>["image/*"]),i=Q(We([])),o=Q(We([])),s=Q(""),a=Q(null),u=Q(!1),c=Q(!1),d=Q(0),f=Q(0),g=Q(1),p,v;async function m(){A(u,!0);const U={perPage:24,sort:"-createdAt",page:l(g)};l(s)&&(U.search=l(s)),l(a)&&(U.filter=`folder="${l(a)}"`);const M=await Vo("media",U);M.ok&&(A(i,M.data.records,!0),A(d,M.data.totalRecords,!0),A(f,M.data.totalPages,!0)),A(u,!1)}async function h(){const U=await Vo("media_folders",{perPage:100,sort:"name"});U.ok&&A(o,U.data.records,!0)}function w(U){const M={url:U.file?.url||U.url||"",alt:U.alt||"",filename:U.filename||U.file?.filename||"",mimeType:U.mimeType||U.file?.mimeType||"",size:U.size||U.file?.size||0};e.onSelect(M),t(!1)}async function b(U){const M=U.target,j=M.files;if(j?.length){A(c,!0);for(const Y of j)await Op(Y);A(c,!1),M.value="",await m()}}function x(U){const M=U.target.value;A(s,M,!0),clearTimeout(v),v=setTimeout(()=>{A(g,1),m()},300)}function S(U){A(a,U,!0),A(g,1),m()}function k(){l(g)>1&&(Ys(g,-1),m())}function C(){l(g)<l(f)&&(Ys(g),m())}function N(){t(!1)}function O(U){U.key==="Escape"&&N()}function E(U){return U?.startsWith("image/")??!1}function D(U){return U.file?.url||U.url||""}gt(()=>{t()&&(A(g,1),A(s,""),A(a,null),m(),h())});var L=ne();cn("keydown",jo,O);var V=q(L);{var G=U=>{var M=SC(),j=q(M),Y=_(j),Z=_(Y),W=T(_(Z),2),H=_(W),ie=_(H);Ho(ie,{class:"h-4 w-4"});var I=T(ie),F=T(H,2),R=_(F);or(R,{class:"h-5 w-5"});var B=T(Z,2),re=_(B),le=_(re);Gu(le,{class:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"});var ke=T(le,2),Ae=T(B,2),we=_(Ae);{var _e=Ie=>{var ze=pC(),fe=_(ze),te=_(fe);Xs(te,{class:"h-4 w-4"});var ae=T(fe,2);Ue(ae,17,()=>l(o),ut,(me,ce)=>{var pe=vC(),Te=_(pe);Xs(Te,{class:"h-4 w-4"});var Be=T(Te);J(()=>{Ee(pe,1,`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm ${l(a)===l(ce).id?"bg-accent font-medium":"hover:bg-accent"}`),$(Be,` ${(l(ce).name||l(ce).title||"Untitled")??""}`)}),ee("click",pe,()=>S(l(ce).id)),y(me,pe)}),J(()=>Ee(fe,1,`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm ${l(a)===null?"bg-accent font-medium":"hover:bg-accent"}`)),ee("click",fe,()=>S(null)),y(Ie,ze)};K(we,Ie=>{l(o).length>0&&Ie(_e)})}var Ce=T(we,2),xe=_(Ce);{var Fe=Ie=>{var ze=mC();y(Ie,ze)},ge=Ie=>{var ze=_C(),fe=T(_(ze),2),te=_(fe);Ho(te,{class:"h-4 w-4"}),ee("click",fe,()=>p.click()),y(Ie,ze)},Ve=Ie=>{var ze=wC();Ue(ze,21,()=>l(i),ut,(fe,te)=>{var ae=xC(),me=_(ae),ce=_(me);{var pe=ot=>{var je=bC();J(Ge=>{X(je,"src",Ge),X(je,"alt",l(te).alt||l(te).filename||"")},[()=>D(l(te))]),y(ot,je)},Te=z(()=>E(l(te).mimeType||l(te).file?.mimeType||"")),Be=ot=>{var je=yC(),Ge=_(je);Ju(Ge,{class:"h-10 w-10 text-muted-foreground"}),y(ot,je)};K(ce,ot=>{l(Te)?ot(pe):ot(Be,-1)})}var dt=T(me,2),Ze=_(dt),it=_(Ze),$e=T(Ze,2),Je=_($e);J(ot=>{$(it,l(te).title||l(te).filename||"Untitled"),$(Je,ot)},[()=>Yu(l(te).size||l(te).file?.size||0)]),ee("click",ae,()=>w(l(te))),y(fe,ae)}),y(Ie,ze)};K(xe,Ie=>{l(u)?Ie(Fe):l(i).length===0?Ie(ge,1):Ie(Ve,-1)})}var He=T(Ae,2);{var tt=Ie=>{var ze=kC(),fe=_(ze),te=_(fe),ae=T(fe,2),me=_(ae),ce=T(me,2),pe=_(ce),Te=T(ce,2);J(()=>{$(te,`${l(d)??""} items`),me.disabled=l(g)<=1,$(pe,`Page ${l(g)??""} of ${l(f)??""}`),Te.disabled=l(g)>=l(f)}),ee("click",me,k),ee("click",Te,C),y(Ie,ze)};K(He,Ie=>{l(f)>1&&Ie(tt)})}var rt=T(j,2);Mn(rt,Ie=>p=Ie,()=>p),J(Ie=>{H.disabled=l(c),$(I,` ${l(c)?"Uploading...":"Upload New"}`),ir(ke,l(s)),X(rt,"accept",Ie)},[()=>r().join(",")]),ee("click",j,Ie=>{Ie.target===Ie.currentTarget&&N()}),ee("click",H,()=>p.click()),ee("click",F,N),ee("input",ke,x),ee("change",rt,b),y(U,M)};K(V,U=>{t()&&U(G)})}y(n,L),ve()}ye(["click","input","change"]);var CC=P('<div class="absolute left-0 top-full mt-1 z-50 min-w-[180px] rounded-md border bg-popover p-1 shadow-md"><button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> YouTube Video</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Image</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Image from URL</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Pull Quote</button> <button type="button" class="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent"><!> Custom HTML</button></div>'),TC=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="bg-popover rounded-lg p-4 shadow-lg w-[400px] space-y-3"><h3 class="text-sm font-medium">Insert YouTube Video</h3> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="YouTube URL (e.g. https://youtube.com/watch?v=...)"/> <div class="flex justify-end gap-2"><button type="button" class="rounded-md px-3 py-1.5 text-sm hover:bg-accent">Cancel</button> <button type="button" class="rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90">Insert</button></div></div></div>'),EC=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"><div class="bg-popover rounded-lg p-4 shadow-lg w-[400px] space-y-3"><h3 class="text-sm font-medium">Insert Image</h3> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Image URL"/> <input type="text" class="w-full rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary" placeholder="Alt text (optional)"/> <div class="flex justify-end gap-2"><button type="button" class="rounded-md px-3 py-1.5 text-sm hover:bg-accent">Cancel</button> <button type="button" class="rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90">Insert</button></div></div></div>'),NC=P('<div class="relative"><button type="button" class="rounded p-1.5 hover:bg-accent flex items-center gap-0.5" title="Insert block"><!> <span class="text-xs">Insert</span></button> <!></div> <!> <!> <!>',1);function AC(n,e){he(e,!0);const t=fn();let r=Q(!1),i=Q(!1),o=Q(!1),s=Q(!1),a=Q(""),u=Q(""),c=Q("");function d(){A(r,!l(r))}function f(){A(r,!1)}function g(M){const j=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/^([a-zA-Z0-9_-]{11})$/];for(const Y of j){const Z=M.match(Y);if(Z)return Z[1]}return null}function p(){const M=g(l(a));if(!M){alert("Invalid YouTube URL");return}t.update(()=>{const j=Dc(M);Ri([j])}),A(a,""),A(i,!1),f()}function v(M){t.update(()=>{const j=ma({src:M.url,altText:M.alt||"",width:void 0,height:void 0,maxWidth:800});Ri([j])}),A(s,!1),f()}function m(){if(!l(u)){alert("Please enter an image URL");return}t.update(()=>{const M=ma({src:l(u),altText:l(c)||"",width:void 0,height:void 0,maxWidth:800});Ri([M])}),A(u,""),A(c,""),A(o,!1),f()}function h(){t.update(()=>{const M=fC("","");Ri([M]);const j=Ct();M.insertAfter(j)}),f()}function w(){t.update(()=>{const M=oC("");Ri([M]);const j=Ct();M.insertAfter(j)}),f()}function b(M){M.key==="Enter"&&(M.preventDefault(),p()),M.key==="Escape"&&A(i,!1)}function x(M){M.key==="Enter"&&(M.preventDefault(),m()),M.key==="Escape"&&A(o,!1)}var S=NC();cn("click",jo,()=>{l(r)&&f()});var k=q(S),C=_(k),N=_(C);qu(N,{class:"h-4 w-4"});var O=T(C,2);{var E=M=>{var j=CC(),Y=_(j),Z=_(Y);Vy(Z,{class:"h-4 w-4"});var W=T(Y,2),H=_(W);Vl(H,{class:"h-4 w-4"});var ie=T(W,2),I=_(ie);Vl(I,{class:"h-4 w-4"});var F=T(ie,2),R=_(F);Sh(R,{class:"h-4 w-4"});var B=T(F,2),re=_(B);oy(re,{class:"h-4 w-4"}),ee("click",j,le=>le.stopPropagation()),ee("click",Y,()=>{A(i,!0),A(r,!1)}),ee("click",W,()=>{A(s,!0),A(r,!1)}),ee("click",ie,()=>{A(o,!0),A(r,!1)}),ee("click",F,h),ee("click",B,w),y(M,j)};K(O,M=>{l(r)&&M(E)})}var D=T(k,2);{var L=M=>{var j=TC(),Y=_(j),Z=T(_(Y),2),W=T(Z,2),H=_(W),ie=T(H,2);ee("click",j,()=>A(i,!1)),ee("click",Y,I=>I.stopPropagation()),ee("keydown",Z,b),Mt(Z,()=>l(a),I=>A(a,I)),ee("click",H,()=>A(i,!1)),ee("click",ie,p),y(M,j)};K(D,M=>{l(i)&&M(L)})}var V=T(D,2);{var G=M=>{var j=EC(),Y=_(j),Z=T(_(Y),2),W=T(Z,2),H=T(W,2),ie=_(H),I=T(ie,2);ee("click",j,()=>A(o,!1)),ee("click",Y,F=>F.stopPropagation()),ee("keydown",Z,x),Mt(Z,()=>l(u),F=>A(u,F)),ee("keydown",W,x),Mt(W,()=>l(c),F=>A(c,F)),ee("click",ie,()=>A(o,!1)),ee("click",I,m),y(M,j)};K(V,M=>{l(o)&&M(G)})}var U=T(V,2);Ip(U,{accept:["image/jpeg","image/png","image/webp","image/svg+xml"],onSelect:v,get open(){return l(s)},set open(M){A(s,M,!0)}}),ee("click",C,M=>{M.stopPropagation(),d()}),y(n,S),ve()}ye(["click","keydown"]);var MC=P('<div class="flex flex-wrap gap-0.5 border-b bg-muted/30 p-1.5"><button type="button" title="Bold"><!></button> <button type="button" title="Italic"><!></button> <button type="button" title="Underline"><!></button> <button type="button" title="Strikethrough"><!></button> <div class="mx-1 w-px bg-border"></div> <button type="button" title="Heading 1"><!></button> <button type="button" title="Heading 2"><!></button> <button type="button" title="Heading 3"><!></button> <div class="mx-1 w-px bg-border"></div> <button type="button" title="Bullet List"><!></button> <button type="button" title="Ordered List"><!></button> <button type="button" title="Blockquote"><!></button> <button type="button" title="Code Block"><!></button> <div class="mx-1 w-px bg-border"></div> <!> <div class="mx-1 w-px bg-border"></div> <button type="button" class="rounded p-1.5 hover:bg-accent" title="Undo"><!></button> <button type="button" class="rounded p-1.5 hover:bg-accent" title="Redo"><!></button></div>');function PC(n,e){he(e,!0);const t=fn();let r=Q(!1),i=Q(!1),o=Q(!1),s=Q(!1),a=Q("paragraph");function u(){const I=be();if(ue(I)){A(r,I.hasFormat("bold"),!0),A(i,I.hasFormat("italic"),!0),A(o,I.hasFormat("underline"),!0),A(s,I.hasFormat("strikethrough"),!0);const F=I.anchor.getNode(),R=F.getKey()==="root"?F:F.getTopLevelElementOrThrow();if(Dk(R))A(a,R.getTag(),!0);else if(lt(R)){const B=rp(F,qa);A(a,B?B.getListType():R.getListType(),!0)}else A(a,R.getType(),!0)}}_t(()=>{const I=t.registerCommand(Ma,()=>(u(),!1),Ev),F=t.registerUpdateListener(({editorState:R})=>{R.read(()=>{u()})});return()=>{I(),F()}});function c(I){return`rounded p-1.5 hover:bg-accent ${I?"bg-accent text-accent-foreground":""}`}var d=MC(),f=_(d),g=_(f);ty(g,{class:"h-4 w-4"});var p=T(f,2),v=_(p);my(v,{class:"h-4 w-4"});var m=T(p,2),h=_(m);Ky(h,{class:"h-4 w-4"});var w=T(m,2),b=_(w);Ry(b,{class:"h-4 w-4"});var x=T(w,4),S=_(x);gy(S,{class:"h-4 w-4"});var k=T(x,2),C=_(k);vy(C,{class:"h-4 w-4"});var N=T(k,2),O=_(N);hy(O,{class:"h-4 w-4"});var E=T(N,4),D=_(E);kh(D,{class:"h-4 w-4"});var L=T(E,2),V=_(L);by(V,{class:"h-4 w-4"});var G=T(L,2),U=_(G);Sh(U,{class:"h-4 w-4"});var M=T(G,2),j=_(M);sy(j,{class:"h-4 w-4"});var Y=T(M,4);AC(Y,{});var Z=T(Y,4),W=_(Z);Wy(W,{class:"h-4 w-4"});var H=T(Z,2),ie=_(H);Dy(ie,{class:"h-4 w-4"}),J((I,F,R,B,re,le,ke,Ae,we,_e,Ce)=>{Ee(f,1,I),Ee(p,1,F),Ee(m,1,R),Ee(w,1,B),Ee(x,1,re),Ee(k,1,le),Ee(N,1,ke),Ee(E,1,Ae),Ee(L,1,we),Ee(G,1,_e),Ee(M,1,Ce)},[()=>wt(c(l(r))),()=>wt(c(l(i))),()=>wt(c(l(o))),()=>wt(c(l(s))),()=>wt(c(l(a)==="h1")),()=>wt(c(l(a)==="h2")),()=>wt(c(l(a)==="h3")),()=>wt(c(l(a)==="bullet")),()=>wt(c(l(a)==="number")),()=>wt(c(l(a)==="quote")),()=>wt(c(l(a)==="code"))]),ee("click",f,()=>OS(t)),ee("click",p,()=>DS(t)),ee("click",m,()=>FS(t)),ee("click",w,()=>IS(t)),ee("click",x,()=>Nl(t,l(a),"h1")),ee("click",k,()=>Nl(t,l(a),"h2")),ee("click",N,()=>Nl(t,l(a),"h3")),ee("click",E,()=>NS(t,l(a))),ee("click",L,()=>AS(t,l(a))),ee("click",G,()=>MS(t,l(a))),ee("click",M,()=>PS(t,l(a))),ee("click",Z,()=>LS(t)),ee("click",H,()=>RS(t)),y(n,d),ve()}ye(["click"]);var OC=P('<span class="text-destructive">*</span>'),DC=P('<!> <div class="relative"><!> <!></div> <!> <!> <!> <!> <!>',1),IC=P('<p class="mt-1 text-xs text-destructive"> </p>'),FC=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div><!></div> <!></div>');function LC(n,e){he(e,!0);let t=se(e,"value",15);function r(){if(t()){if(typeof t()=="string")try{return JSON.parse(t()),t()}catch{return}if(typeof t()=="object")return JSON.stringify(t())}}const i=r(),o={paragraph:"mb-2",heading:{h1:"text-2xl font-bold mb-3",h2:"text-xl font-bold mb-2",h3:"text-lg font-semibold mb-2"},list:{ul:"list-disc pl-6 mb-2",ol:"list-decimal pl-6 mb-2",listitem:"mb-1",nested:{listitem:"list-none"}},quote:"border-l-4 border-muted-foreground/30 pl-4 italic mb-2",code:"bg-muted rounded px-1 py-0.5 font-mono text-sm block mb-2",link:"text-primary underline",text:{bold:"font-bold",italic:"italic",underline:"underline",strikethrough:"line-through",code:"bg-muted rounded px-1 font-mono text-sm"}},s={namespace:e.field.name,nodes:[hs,Ja,qa,vs,_s,Hr,ps,ms,bs,Ga,...hC],theme:o,onError:w=>console.error("[Lexical]",w),editorState:i};function a(w,b){const x=w.toJSON();t(JSON.stringify(x))}var u=FC(),c=_(u),d=_(c),f=T(d);{var g=w=>{var b=OC();y(w,b)};K(f,w=>{e.field.required&&w(g)})}var p=T(c,2),v=_(p);eC(v,{get initialConfig(){return s},children:(w,b)=>{var x=DC(),S=q(x);PC(S,{});var k=T(S,2),C=_(k);pp(C,{});var N=T(C,2);Cp(N,{className:"max-w-none px-4 py-3 min-h-[200px] focus:outline-none"});var O=T(k,2);zk(O,{});var E=T(O,2);Zk(E,{});var D=T(E,2);ZS(D,{});var L=T(D,2);Pp(L,{});var V=T(L,2);XS(V,{onChange:a,ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0}),y(w,x)},$$slots:{default:!0}});var m=T(p,2);{var h=w=>{var b=IC(),x=_(b);J(()=>$(x,e.error)),y(w,b)};K(m,w=>{e.error&&w(h)})}J(()=>{$(d,`${e.field.label??""} `),Ee(p,1,`rounded-md border ${e.error?"border-destructive":""}`)}),y(n,u),ve()}var RC=P('<span class="text-destructive">*</span>'),zC=P('<span class="inline-flex items-center gap-1 rounded-full border bg-secondary px-2 py-0.5 text-xs"> <button type="button" class="hover:text-destructive"><!></button></span>'),BC=P('<p class="px-3 py-2 text-sm text-muted-foreground">Loading...</p>'),UC=P('<p class="px-3 py-2 text-sm text-muted-foreground">No results</p>'),jC=P('<button type="button" class="flex w-full items-center px-3 py-2 text-left text-sm hover:bg-accent"> </button>'),WC=P('<div class="fixed inset-0 z-40"></div> <div class="absolute z-50 mt-1 max-h-48 w-full overflow-y-auto rounded-md border bg-popover shadow-lg"><!></div>',1),KC=P('<div class="relative"><div><!> <input type="text" class="min-w-[120px] flex-1 bg-transparent px-1 py-0.5 text-sm outline-none"/></div> <!></div>'),HC=P('<div><span> </span> <button type="button" class="text-muted-foreground hover:text-destructive" aria-label="Clear selection"><!></button></div>'),VC=P('<!> <input type="text"/>',1),JC=P('<p class="px-3 py-2 text-sm text-muted-foreground">Loading...</p>'),qC=P('<p class="px-3 py-2 text-sm text-muted-foreground">No results</p>'),GC=P('<button type="button" class="flex w-full items-center px-3 py-2 text-left text-sm hover:bg-accent"> </button>'),YC=P('<div class="fixed inset-0 z-40"></div> <div class="absolute z-50 mt-1 max-h-48 w-full overflow-y-auto rounded-md border bg-popover shadow-lg"><!></div>',1),ZC=P('<div class="relative"><!> <!></div>'),XC=P('<p class="mt-1 text-xs text-destructive"> </p>'),QC=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <!></div>');function $C(n,e){he(e,!0);let t=se(e,"value",15),r=Q(""),i=Q(We([])),o=Q(!1),s=Q(!1),a,u=Q(null),c=Q(We([])),d=z(()=>e.field.relationType==="manyToMany"),f=z(()=>l(d)?Array.isArray(t())?l(c).length>0?l(c):t():[]:[]);_t(async()=>{if(e.field.relatesTo){if(!l(d)&&t()&&typeof t()=="string"){const M=await ea(e.field.relatesTo,t());M.ok&&A(u,M.data,!0)}else if(l(d)&&Array.isArray(t())&&t().length>0&&t().some(j=>typeof j=="string")){const j=t().map(Z=>typeof Z=="string"?Z:Z.id),Y=await Promise.all(j.map(async Z=>{const W=await ea(e.field.relatesTo,Z);return W.ok?W.data:null}));A(c,Y.filter(Z=>Z!==null),!0)}}});function g(){if(!e.field.relatesTo)return"name";const M=vo(hn.collections,e.field.relatesTo);if(M?.admin?.useAsTitle)return M.admin.useAsTitle;const j=["name","title","label","slug"];for(const Y of j)if(M?.fields?.some(Z=>Z.name===Y))return Y;return"name"}async function p(M){if(!e.field.relatesTo)return;A(s,!0);const j=g(),Y={perPage:20,fields:`id,${j}`};if(M.trim()){const W=M.trim().replace(/'/g,"''");Y.filter=`${j}~'${W}'`}const Z=await Vo(e.field.relatesTo,Y);A(s,!1),Z.ok&&A(i,Z.data.records,!0)}function v(M){const j=M.target;A(r,j.value,!0),clearTimeout(a),a=setTimeout(()=>p(l(r)),300)}function m(){A(o,!0),p(l(r))}function h(M){return M.name||M.title||M.label||M.slug||M.id||"-"}function w(M){l(d)?(Array.isArray(t())?t():[]).map(Y=>typeof Y=="object"?Y.id:Y).includes(M.id)||(t([...Array.isArray(t())?t():[],M]),A(c,[...l(c),M],!0)):(t(M.id),A(u,M,!0),A(o,!1)),A(r,"")}function b(M){l(d)&&Array.isArray(t())&&(t(t().filter(j=>(typeof j=="object"?j.id:j)!==M)),A(c,l(c).filter(j=>j.id!==M),!0))}function x(){t(l(d)?[]:null)}let S=z(()=>{if(l(d)||!t())return"";if(typeof t()=="object")return h(t());if(l(u))return h(l(u));const M=l(i).find(j=>j.id===t());return M?h(M):t()});var k=QC(),C=_(k),N=_(C),O=T(N);{var E=M=>{var j=RC();y(M,j)};K(O,M=>{e.field.required&&M(E)})}var D=T(C,2);{var L=M=>{var j=KC(),Y=_(j),Z=_(Y);Ue(Z,17,()=>l(f),ut,(I,F)=>{const R=z(()=>typeof l(F)=="object"?l(F).id:l(F)),B=z(()=>typeof l(F)=="object"?h(l(F)):l(F));var re=zC(),le=_(re),ke=T(le),Ae=_(ke);or(Ae,{class:"h-3 w-3"}),J(()=>{$(le,`${l(B)??""} `),X(ke,"aria-label",`Remove ${l(B)??""}`)}),ee("click",ke,()=>b(l(R))),y(I,re)});var W=T(Z,2),H=T(Y,2);{var ie=I=>{var F=WC(),R=q(F),B=T(R,2),re=_(B);{var le=we=>{var _e=BC();y(we,_e)},ke=we=>{var _e=UC();y(we,_e)},Ae=we=>{var _e=ne(),Ce=q(_e);Ue(Ce,17,()=>l(i),ut,(xe,Fe)=>{var ge=jC(),Ve=_(ge);J(He=>$(Ve,He),[()=>h(l(Fe))]),ee("click",ge,()=>w(l(Fe))),y(xe,ge)}),y(we,_e)};K(re,we=>{l(s)?we(le):l(i).length===0?we(ke,1):we(Ae,-1)})}ee("click",R,()=>A(o,!1)),ee("keydown",R,()=>{}),y(I,F)};K(H,I=>{l(o)&&I(ie)})}J(()=>{Ee(Y,1,`flex min-h-10 w-full flex-wrap items-center gap-1 rounded-md border bg-background px-2 py-1.5 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-ring ${e.error?"border-destructive":""}`),ir(W,l(r)),X(W,"placeholder",l(f).length===0?`Select ${e.field.relatesTo}...`:"Add more...")}),ee("input",W,v),cn("focus",W,m),y(M,j)},V=M=>{var j=ZC(),Y=_(j);{var Z=I=>{var F=HC(),R=_(F),B=_(R),re=T(R,2),le=_(re);or(le,{class:"h-4 w-4"}),J(()=>{Ee(F,1,`flex h-10 w-full items-center justify-between rounded-md border bg-background px-3 text-sm ${e.error?"border-destructive":""}`),$(B,l(S))}),ee("click",re,x),y(I,F)},W=I=>{var F=VC(),R=q(F);Gu(R,{class:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"});var B=T(R,2);J(()=>{ir(B,l(r)),Ee(B,1,`h-10 w-full rounded-md border bg-background pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(B,"placeholder",`Select ${e.field.relatesTo??""}...`)}),ee("input",B,v),cn("focus",B,m),y(I,F)};K(Y,I=>{l(S)?I(Z):I(W,-1)})}var H=T(Y,2);{var ie=I=>{var F=YC(),R=q(F),B=T(R,2),re=_(B);{var le=we=>{var _e=JC();y(we,_e)},ke=we=>{var _e=qC();y(we,_e)},Ae=we=>{var _e=ne(),Ce=q(_e);Ue(Ce,17,()=>l(i),ut,(xe,Fe)=>{var ge=GC(),Ve=_(ge);J(He=>$(Ve,He),[()=>h(l(Fe))]),ee("click",ge,()=>w(l(Fe))),y(xe,ge)}),y(we,_e)};K(re,we=>{l(s)?we(le):l(i).length===0?we(ke,1):we(Ae,-1)})}ee("click",R,()=>A(o,!1)),ee("keydown",R,()=>{}),y(I,F)};K(H,I=>{l(o)&&!l(S)&&I(ie)})}y(M,j)};K(D,M=>{l(d)?M(L):M(V,-1)})}var G=T(D,2);{var U=M=>{var j=XC(),Y=_(j);J(()=>$(Y,e.error)),y(M,j)};K(G,M=>{e.error&&M(U)})}J(()=>{X(C,"for",e.field.name),$(N,`${e.field.label??""} `)}),y(n,k),ve()}ye(["click","input","keydown"]);var eT=P('<span class="text-destructive">*</span>'),tT=P('<div class="relative"><button type="button" class="group relative h-16 w-16 shrink-0 overflow-hidden rounded"><img class="h-full w-full object-cover"/> <div class="absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100"><!></div></button></div>'),nT=P('<div class="flex h-16 w-16 shrink-0 items-center justify-center rounded bg-muted text-lg">📄</div>'),rT=P('<div class="flex items-start gap-3 rounded-md border bg-muted/30 p-2"><!> <div class="flex-1 space-y-1"><p class="text-xs font-medium"> </p> <p class="text-xs text-muted-foreground"> </p> <div><label class="mb-0.5 block text-xs font-medium text-muted-foreground">Alt text</label> <input type="text" placeholder="Describe the image" class="h-7 w-full rounded border bg-background px-2 text-xs"/></div></div> <button type="button" class="shrink-0 rounded p-1 text-muted-foreground hover:text-destructive"><!></button></div>'),iT=P('<div class="mb-2 space-y-2"></div>'),oT=P('<p class="mt-1 text-xs text-destructive"> </p>'),sT=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4" role="button" tabindex="0"><div class="relative max-h-[90vh] max-w-[90vw]"><button type="button" class="absolute -right-2 -top-2 rounded-full bg-white p-2 text-black shadow-lg hover:bg-gray-100"><!></button> <button type="button" class="appearance-none border-0 bg-transparent p-0 cursor-pointer"><img alt="Preview" class="max-h-[90vh] max-w-[90vw] rounded object-contain"/></button></div></div>'),aT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <button type="button"><!> <!></button> <button type="button" class="inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent"><!> Browse Media</button> <input type="file" class="hidden"/> <!></div> <!> <!>',1);function lT(n,e){he(e,!0);let t=se(e,"value",15),r=Q(!1),i,o=Q(null),s=Q(!1),a=z(()=>{if(!t())return[];let H=t();if(typeof H=="string")try{H=JSON.parse(H)}catch{return[]}return e.field.multiple?Array.isArray(H)?H:[]:typeof H=="object"&&H?.url?[H]:[]});function u(H){return H?.startsWith("image/")??!1}async function c(H){const ie=H.target,I=ie.files;if(I?.length){A(r,!0);for(const F of I){const R=await Op(F);if(R.ok){const B={url:R.data.url,alt:"",filename:R.data.filename,mimeType:R.data.mimeType,size:R.data.size};if(e.field.multiple){const re=Array.isArray(t())?[...t()]:[];t([...re,B])}else t(B);Ke.success(`Uploaded ${F.name}`);try{await Jl("media",{title:F.name,alt:"",filename:R.data.filename,mimeType:R.data.mimeType,size:R.data.size,file:{url:R.data.url,filename:R.data.filename,mimeType:R.data.mimeType,size:R.data.size}})}catch{}}else Ke.error(`Failed to upload ${F.name}: ${R.error}`)}A(r,!1),ie.value=""}}function d(H){e.field.multiple&&Array.isArray(t())?t(t().filter((ie,I)=>I!==H)):t(null)}function f(H,ie){e.field.multiple&&Array.isArray(t())?t(t().map((I,F)=>F===H?{...I,alt:ie}:I)):t()&&t({...t(),alt:ie})}function g(H){A(o,H,!0)}function p(){A(o,null)}function v(H){const ie={url:H.url,alt:H.alt||"",filename:H.filename,mimeType:H.mimeType,size:H.size};if(e.field.multiple){const I=Array.isArray(t())?[...t()]:[];t([...I,ie])}else t(ie)}var m=aT(),h=q(m),w=_(h),b=_(w),x=T(b);{var S=H=>{var ie=eT();y(H,ie)};K(x,H=>{e.field.required&&H(S)})}var k=T(w,2);{var C=H=>{var ie=iT();Ue(ie,21,()=>l(a),ut,(I,F,R)=>{var B=rT(),re=_(B);{var le=Ie=>{var ze=tT(),fe=_(ze),te=_(fe),ae=T(te,2),me=_(ae);wh(me,{class:"h-5 w-5 text-white"}),J(()=>{X(te,"src",l(F).url),X(te,"alt",l(F).alt||l(F).filename)}),ee("click",fe,()=>g(l(F).url)),y(Ie,ze)},ke=z(()=>u(l(F).mimeType)&&l(F).url),Ae=Ie=>{var ze=nT();y(Ie,ze)};K(re,Ie=>{l(ke)?Ie(le):Ie(Ae,-1)})}var we=T(re,2),_e=_(we),Ce=_(_e),xe=T(_e,2),Fe=_(xe),ge=T(xe,2),Ve=_(ge);X(Ve,"for",`alt-${R}`);var He=T(Ve,2);X(He,"id",`alt-${R}`);var tt=T(we,2),rt=_(tt);or(rt,{class:"h-4 w-4"}),J(Ie=>{$(Ce,l(F).filename),$(Fe,Ie),ir(He,l(F).alt)},[()=>Yu(l(F).size)]),ee("input",He,Ie=>f(R,Ie.target.value)),ee("click",tt,()=>d(R)),y(I,B)}),y(H,ie)};K(k,H=>{l(a).length>0&&H(C)})}var N=T(k,2),O=_(N);Ho(O,{class:"h-4 w-4"});var E=T(O,2);{var D=H=>{var ie=ai("Uploading...");y(H,ie)},L=H=>{var ie=ai();J(()=>$(ie,`${l(a).length>0?"Add":"Upload"} File${e.field.multiple?"s":""}`)),y(H,ie)};K(E,H=>{l(r)?H(D):H(L,-1)})}var V=T(N,2),G=_(V);Xs(G,{class:"h-4 w-4"});var U=T(V,2);Mn(U,H=>i=H,()=>i);var M=T(U,2);{var j=H=>{var ie=oT(),I=_(ie);J(()=>$(I,e.error)),y(H,ie)};K(M,H=>{e.error&&H(j)})}var Y=T(h,2);{let H=z(()=>e.field.accept||["image/*"]);Ip(Y,{get accept(){return l(H)},onSelect:v,get open(){return l(s)},set open(ie){A(s,ie,!0)}})}var Z=T(Y,2);{var W=H=>{var ie=sT(),I=_(ie),F=_(I),R=_(F);or(R,{class:"h-5 w-5"});var B=T(F,2),re=_(B);J(()=>X(re,"src",l(o))),ee("click",ie,p),ee("keydown",ie,le=>le.key==="Escape"&&p()),ee("click",F,p),ee("click",B,le=>le.stopPropagation()),y(H,ie)};K(Z,H=>{l(o)&&H(W)})}J(H=>{$(b,`${e.field.label??""} `),N.disabled=l(r),Ee(N,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),U.multiple=e.field.multiple||!1,X(U,"accept",H)},[()=>e.field.accept?.join(",")]),ee("click",N,()=>i.click()),ee("click",V,()=>A(s,!0)),ee("change",U,c),y(n,m),ve()}ye(["click","input","change","keydown"]);var uT=P('<span class="text-destructive">*</span>'),cT=P('<button type="button" class="group relative h-16 w-16 shrink-0 overflow-hidden rounded"><img class="h-full w-full object-cover"/> <div class="absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 transition-opacity group-hover:opacity-100"><!></div></button>'),dT=P('<div class="flex h-16 w-16 shrink-0 items-center justify-center rounded bg-muted text-lg">📄</div>'),fT=P('<p class="text-muted-foreground"> </p>'),gT=P('<div class="mb-2 flex items-start gap-3 rounded-md border bg-muted/30 p-2"><!> <div class="flex-1 space-y-1 text-xs"><p class="font-medium"> </p> <!></div> <button type="button" class="shrink-0 rounded p-1 text-muted-foreground hover:text-destructive" aria-label="Clear"><!></button></div>'),hT=P('<button type="button"><!> </button>'),vT=P('<p class="mt-1 text-xs text-destructive"> </p>'),pT=P('<div class="fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4" role="button" tabindex="0"><img class="max-h-[90vh] max-w-[90vw] rounded object-contain"/></div>'),mT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <input type="file" class="hidden"/> <!></div> <!>',1);function _T(n,e){he(e,!0);let t=se(e,"value",15),r=Q(!1),i=Q(null),o,s=Q(!1);async function a(){if(!t()){A(i,null);return}if(typeof t()=="object"&&t()&&"url"in t()){A(i,t(),!0);return}if(typeof t()=="string"&&e.field.relatesTo){const L=await ea(e.field.relatesTo,t());L.ok?A(i,L.data,!0):A(i,null)}}_t(()=>{a()}),gt(()=>{a()});function u(L){return!!L&&L.startsWith("image/")}async function c(L){const V=L.target,G=V.files?.[0];if(!G)return;if(!e.field.relatesTo){Ke.error("field.Upload missing relatesTo");return}A(r,!0);const U=await Dp(e.field.relatesTo,G);A(r,!1),V.value="",U.ok?(t(U.data.id),A(i,U.data,!0),Ke.success(`Uploaded ${G.name}`)):Ke.error(`Upload failed: ${U.error}`)}function d(){t(null),A(i,null)}function f(){A(s,!0)}function g(){A(s,!1)}var p=mT(),v=q(p),m=_(v),h=_(m),w=T(h);{var b=L=>{var V=uT();y(L,V)};K(w,L=>{e.field.required&&L(b)})}var x=T(m,2);{var S=L=>{var V=gT(),G=_(V);{var U=R=>{var B=cT(),re=_(B),le=T(re,2),ke=_(le);wh(ke,{class:"h-5 w-5 text-white"}),J(()=>{X(re,"src",l(i).url),X(re,"alt",l(i).alt??l(i).filename)}),ee("click",B,f),y(R,B)},M=z(()=>u(l(i).mimeType)&&l(i).url),j=R=>{var B=dT();y(R,B)};K(G,R=>{l(M)?R(U):R(j,-1)})}var Y=T(G,2),Z=_(Y),W=_(Z),H=T(Z,2);{var ie=R=>{var B=fT(),re=_(B);J(le=>$(re,le),[()=>Yu(l(i).size)]),y(R,B)};K(H,R=>{typeof l(i).size=="number"&&R(ie)})}var I=T(Y,2),F=_(I);or(F,{class:"h-4 w-4"}),J(()=>$(W,l(i).filename)),ee("click",I,d),y(L,V)},k=L=>{var V=hT(),G=_(V);Ho(G,{class:"h-4 w-4"});var U=T(G);J(()=>{V.disabled=l(r),Ee(V,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),$(U,` ${l(r)?"Uploading…":"Upload File"}`)}),ee("click",V,()=>o.click()),y(L,V)};K(x,L=>{l(i)?L(S):L(k,-1)})}var C=T(x,2);Mn(C,L=>o=L,()=>o);var N=T(C,2);{var O=L=>{var V=vT(),G=_(V);J(()=>$(G,e.error)),y(L,V)};K(N,L=>{e.error&&L(O)})}var E=T(v,2);{var D=L=>{var V=pT(),G=_(V);J(()=>{X(G,"src",l(i).url),X(G,"alt",l(i).alt??l(i).filename)}),ee("click",V,g),ee("keydown",V,U=>U.key==="Escape"&&g()),y(L,V)};K(E,L=>{l(s)&&l(i)&&l(i).url&&L(D)})}J(()=>$(h,`${e.field.label??""} `)),ee("change",C,c),y(n,p),ve()}ye(["click","change","keydown"]);var bT=P('<span class="text-destructive">*</span>'),yT=P('<img class="h-full w-full object-cover"/>'),xT=P('<div class="flex h-full w-full items-center justify-center bg-muted text-2xl">📄</div>'),wT=P('<div class="group relative aspect-square overflow-hidden rounded border"><!> <div class="absolute inset-x-0 bottom-0 flex justify-between bg-black/60 opacity-0 transition-opacity group-hover:opacity-100"><button type="button" class="p-1 text-white" aria-label="Move up"><!></button> <button type="button" class="p-1 text-white" aria-label="Move down"><!></button> <button type="button" class="p-1 text-white" aria-label="Remove"><!></button></div></div>'),kT=P('<div class="mb-2 grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-6"></div>'),ST=P('<p class="mt-1 text-xs text-destructive"> </p>'),CT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <!> <button type="button"><!> </button> <input type="file" multiple="" class="hidden"/> <!></div>');function TT(n,e){he(e,!0);let t=se(e,"value",15),r=Q(!1),i=Q(We([])),o;async function s(){const E=Array.isArray(t())?t():[];if(E.length===0||!e.field.relatesTo){A(i,[],!0);return}const D=E.map(U=>typeof U=="object"&&U?U.id:U),L=D.map(U=>`id='${U.replace(/'/g,"''")}'`).join(" || "),V=await Vo(e.field.relatesTo,{filter:L,perPage:D.length});if(!V.ok){A(i,[],!0);return}const G=new Map;for(const U of V.data.records)G.set(U.id,U);A(i,D.map(U=>G.get(U)).filter(U=>U!==void 0),!0)}_t(()=>{s()}),gt(()=>{s()});async function a(E){const D=E.target,L=D.files;if(L?.length){if(!e.field.relatesTo){Ke.error("field.Upload missing relatesTo");return}A(r,!0);try{for(const V of L){const G=await Dp(e.field.relatesTo,V);G.ok?(t([...Array.isArray(t())?t():[],G.data.id]),A(i,[...l(i),G.data],!0),Ke.success(`Uploaded ${V.name}`)):Ke.error(`Upload failed for ${V.name}: ${G.error}`)}}finally{A(r,!1),D.value=""}}}function u(E){Array.isArray(t())&&(t(t().filter((D,L)=>L!==E)),A(i,l(i).filter((D,L)=>L!==E),!0))}function c(E){if(!Array.isArray(t())||E===0)return;const D=[...t()];[D[E-1],D[E]]=[D[E],D[E-1]],t(D);const L=[...l(i)];[L[E-1],L[E]]=[L[E],L[E-1]],A(i,L,!0)}function d(E){if(!Array.isArray(t())||E===t().length-1)return;const D=[...t()];[D[E],D[E+1]]=[D[E+1],D[E]],t(D);const L=[...l(i)];[L[E],L[E+1]]=[L[E+1],L[E]],A(i,L,!0)}function f(E){return!!E&&E.startsWith("image/")}var g=CT(),p=_(g),v=_(p),m=T(v);{var h=E=>{var D=bT();y(E,D)};K(m,E=>{e.field.required&&E(h)})}var w=T(p,2);{var b=E=>{var D=kT();Ue(D,23,()=>l(i),L=>L.id,(L,V,G)=>{var U=wT(),M=_(U);{var j=re=>{var le=yT();J(()=>{X(le,"src",l(V).url),X(le,"alt",l(V).alt??l(V).filename)}),y(re,le)},Y=z(()=>f(l(V).mimeType)&&l(V).url),Z=re=>{var le=xT();y(re,le)};K(M,re=>{l(Y)?re(j):re(Z,-1)})}var W=T(M,2),H=_(W),ie=_(H);xh(ie,{class:"h-3 w-3"});var I=T(H,2),F=_(I);Ta(F,{class:"h-3 w-3"});var R=T(I,2),B=_(R);or(B,{class:"h-3 w-3"}),ee("click",H,()=>c(l(G))),ee("click",I,()=>d(l(G))),ee("click",R,()=>u(l(G))),y(L,U)}),y(E,D)};K(w,E=>{l(i).length>0&&E(b)})}var x=T(w,2),S=_(x);Ho(S,{class:"h-4 w-4"});var k=T(S),C=T(x,2);Mn(C,E=>o=E,()=>o);var N=T(C,2);{var O=E=>{var D=ST(),L=_(D);J(()=>$(L,e.error)),y(E,D)};K(N,E=>{e.error&&E(O)})}J(()=>{$(v,`${e.field.label??""} `),x.disabled=l(r),Ee(x,1,`inline-flex h-10 items-center gap-2 rounded-md border bg-background px-4 text-sm hover:bg-accent disabled:opacity-50 ${e.error?"border-destructive":""}`),$(k,` ${l(r)?"Uploading…":l(i).length>0?"Add Files":"Upload Files"}`)}),ee("click",x,()=>o.click()),ee("change",C,a),y(n,g),ve()}ye(["click","change"]);function ET(n,e){he(e,!0);let t=se(e,"value",15);var r=ne(),i=q(r);{var o=a=>{TT(a,{get field(){return e.field},get error(){return e.error},get value(){return t()},set value(u){t(u)}})},s=a=>{_T(a,{get field(){return e.field},get error(){return e.error},get value(){return t()},set value(u){t(u)}})};K(i,a=>{e.field.relationType==="manyToMany"?a(o):a(s,-1)})}y(n,r),ve()}function ig(n){return n.toLowerCase().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/^-+|-+$/g,"").trim()}var NT=P('<span class="text-destructive">*</span>'),AT=P('<p class="mt-1 text-xs text-muted-foreground"> </p>'),MT=P('<p class="mt-1 text-xs text-destructive"> </p>'),PT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="flex items-center gap-2"><input type="text"/> <button type="button" class="flex h-10 w-10 items-center justify-center rounded-md border hover:bg-accent"><!></button></div> <!> <!></div>');function OT(n,e){he(e,!0);let t=se(e,"value",15),r=se(e,"formData",19,()=>({})),i=Q(!0);gt(()=>{l(i)&&e.field.fromField&&r()[e.field.fromField]&&t(ig(String(r()[e.field.fromField])))});function o(){A(i,!l(i)),l(i)&&e.field.fromField&&r()[e.field.fromField]&&t(ig(String(r()[e.field.fromField])))}var s=PT(),a=_(s),u=_(a),c=T(u);{var d=k=>{var C=NT();y(k,C)};K(c,k=>{e.field.required&&k(d)})}var f=T(a,2),g=_(f),p=T(g,2),v=_(p);{var m=k=>{xy(k,{class:"h-4 w-4"})},h=k=>{yy(k,{class:"h-4 w-4"})};K(v,k=>{l(i)?k(m):k(h,-1)})}var w=T(f,2);{var b=k=>{var C=AT(),N=_(C);J(()=>$(N,l(i)?"Auto-generated from "+e.field.fromField:"Manual editing enabled")),y(k,C)};K(w,k=>{e.field.fromField&&k(b)})}var x=T(w,2);{var S=k=>{var C=MT(),N=_(C);J(()=>$(N,e.error)),y(k,C)};K(x,k=>{e.error&&k(S)})}J(()=>{X(a,"for",e.field.name),$(u,`${e.field.label??""} `),X(g,"id",e.field.name),g.disabled=l(i),Ee(g,1,`h-10 flex-1 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-60 ${e.error?"border-destructive":""}`),X(g,"placeholder",e.field.label),X(p,"title",l(i)?"Edit manually":"Auto-generate")}),Mt(g,t),ee("click",p,o),y(n,s),ve()}ye(["click"]);var DT=P('<span class="text-destructive">*</span>'),IT=P('<p class="mt-1 text-xs text-destructive"> </p>'),FT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="flex items-center gap-2"><input type="color" class="h-10 w-12 cursor-pointer rounded border p-1"/> <input type="text" placeholder="#000000"/></div> <!></div>');function LT(n,e){he(e,!0);let t=se(e,"value",15),r=z(()=>t()&&/^#[0-9a-fA-F]{6}$/.test(t())?t():"#000000");function i(m){t(m.target.value)}var o=FT(),s=_(o),a=_(s),u=T(a);{var c=m=>{var h=DT();y(m,h)};K(u,m=>{e.field.required&&m(c)})}var d=T(s,2),f=_(d),g=T(f,2);X(g,"maxlength",7);var p=T(d,2);{var v=m=>{var h=IT(),w=_(h);J(()=>$(w,e.error)),y(m,h)};K(p,m=>{e.error&&m(v)})}J(()=>{X(s,"for",e.field.name),$(a,`${e.field.label??""} `),ir(f,l(r)),X(g,"id",e.field.name),Ee(g,1,`h-10 flex-1 rounded-md border bg-background px-3 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),ee("input",f,i),Mt(g,t),y(n,o),ve()}ye(["input"]);var RT=P('<span class="text-destructive">*</span>'),zT=P('<div class="grid grid-cols-[1fr_1fr_auto] gap-2 text-xs text-muted-foreground"><span>Key</span> <span>Value</span> <span class="w-8"></span></div>'),BT=P('<div class="grid grid-cols-[1fr_1fr_auto] gap-2"><input type="text" placeholder="key"/> <input type="text" placeholder="value"/> <button type="button" class="flex h-9 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive" title="Remove"><!></button></div>'),UT=P('<p class="mt-1 text-xs text-destructive"> </p>'),jT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div class="space-y-2"><!> <!> <button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-md border border-dashed px-3 text-sm text-muted-foreground hover:border-primary hover:text-primary"><!> Add entry</button></div> <!></div>');function WT(n,e){he(e,!0);let t=se(e,"value",15);function r(E){let D={};if(typeof E=="string")try{D=JSON.parse(E)}catch{return[]}else E&&typeof E=="object"&&!Array.isArray(E)&&(D=E);const L=Object.entries(D);return L.length>0?L.map(([V,G])=>({key:V,value:String(G)})):[]}let i=Q(We(r(t())));function o(){const E={};for(const D of l(i)){const L=D.key.trim();L&&(E[L]=D.value)}t(JSON.stringify(E))}let s=Q(We(t()));gt(()=>{if(t()!==l(s)){const E=r(t());JSON.stringify(E)!==JSON.stringify(l(i).map(D=>({key:D.key,value:D.value})))&&A(i,E,!0),A(s,t(),!0)}});function a(){l(i).push({key:"",value:""})}function u(E){l(i).splice(E,1),o()}function c(E,D){l(i)[E].key=D.target.value,o()}function d(E,D){l(i)[E].value=D.target.value,o()}function f(E){E.key==="Enter"&&(E.preventDefault(),a())}var g=jT(),p=_(g),v=_(p),m=T(v);{var h=E=>{var D=RT();y(E,D)};K(m,E=>{e.field.required&&E(h)})}var w=T(p,2),b=_(w);{var x=E=>{var D=zT();y(E,D)};K(b,E=>{l(i).length>0&&E(x)})}var S=T(b,2);Ue(S,17,()=>l(i),ut,(E,D,L)=>{var V=BT(),G=_(V),U=T(G,2),M=T(U,2),j=_(M);or(j,{class:"h-4 w-4"}),J(()=>{ir(G,l(D).key),Ee(G,1,`h-9 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),ir(U,l(D).value),Ee(U,1,`h-9 rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`)}),ee("input",G,Y=>c(L,Y)),ee("keydown",G,f),ee("input",U,Y=>d(L,Y)),ee("keydown",U,f),ee("click",M,()=>u(L)),y(E,V)});var k=T(S,2),C=_(k);qu(C,{class:"h-4 w-4"});var N=T(w,2);{var O=E=>{var D=UT(),L=_(D);J(()=>$(L,e.error)),y(E,D)};K(N,E=>{e.error&&E(O)})}J(()=>{X(p,"for",e.field.name),$(v,`${e.field.label??""} `)}),ee("click",k,a),y(n,g),ve()}ye(["input","keydown","click"]);var KT=P('<span class="text-destructive">*</span>'),HT=P('<span class="inline-flex items-center gap-1 rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary"> <button type="button" class="hover:text-destructive"><!></button></span>'),VT=P('<p class="mt-1 text-xs text-muted-foreground"> </p>'),JT=P('<p class="mt-1 text-xs text-destructive"> </p>'),qT=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <div><!> <input type="text" class="min-w-[120px] flex-1 bg-transparent py-1 text-sm outline-none placeholder:text-muted-foreground"/></div> <!> <!></div>');function GT(n,e){he(e,!0);let t=se(e,"value",15),r=z(()=>Array.isArray(t())?t():[]),i=Q("");function o(k){const C=k.trim();C&&(l(r).includes(C)||e.field.maxItems&&l(r).length>=e.field.maxItems||(t([...l(r),C]),A(i,"")))}function s(k){t(l(r).filter((C,N)=>N!==k))}function a(k){(k.key==="Enter"||k.key===",")&&(k.preventDefault(),o(l(i))),k.key==="Backspace"&&!l(i)&&l(r).length>0&&s(l(r).length-1)}function u(k){const C=k.clipboardData?.getData("text");if(C?.includes(",")){k.preventDefault();const N=C.split(",");for(const O of N)o(O)}}var c=qT(),d=_(c),f=_(d),g=T(f);{var p=k=>{var C=KT();y(k,C)};K(g,k=>{e.field.required&&k(p)})}var v=T(d,2),m=_(v);Ue(m,17,()=>l(r),ut,(k,C,N)=>{var O=HT(),E=_(O),D=T(E),L=_(D);or(L,{class:"h-3 w-3"}),J(()=>$(E,`${l(C)??""} `)),ee("click",D,()=>s(N)),y(k,O)});var h=T(m,2),w=T(v,2);{var b=k=>{var C=VT(),N=_(C);J(()=>$(N,`${l(r).length??""}/${e.field.maxItems??""} items`)),y(k,C)};K(w,k=>{e.field.maxItems&&k(b)})}var x=T(w,2);{var S=k=>{var C=JT(),N=_(C);J(()=>$(N,e.error)),y(k,C)};K(x,k=>{e.error&&k(S)})}J(k=>{X(d,"for",e.field.name),$(f,`${e.field.label??""} `),Ee(v,1,`flex min-h-10 w-full flex-wrap items-center gap-1.5 rounded-md border bg-background px-3 py-1.5 focus-within:ring-2 focus-within:ring-ring ${e.error?"border-destructive":""}`),X(h,"id",e.field.name),X(h,"placeholder",k)},[()=>l(r).length===0?`Add ${e.field.label.toLowerCase()}...`:"Add more..."]),ee("keydown",h,a),cn("paste",h,u),Mt(h,()=>l(i),k=>A(i,k)),y(n,c),ve()}ye(["click","keydown"]);var YT=P('<p class="parse-error svelte-13ec6kv"> </p>'),ZT=P('<div class="card svelte-13ec6kv"><header class="svelte-13ec6kv"><span class="title svelte-13ec6kv"> </span> <div class="actions svelte-13ec6kv"><button type="button" aria-label="Move up" class="svelte-13ec6kv">▲</button> <button type="button" aria-label="Move down" class="svelte-13ec6kv">▼</button> <button type="button" aria-label="Delete" class="svelte-13ec6kv">×</button></div></header> <textarea rows="6"></textarea> <!> <button type="button">Save</button></div>');function Fp(n,e){he(e,!0);const t=z(()=>{const{id:x,...S}=e.value;return S});let r=Q(We(JSON.stringify(l(t),null,2))),i=Q("");function o(){try{const x=JSON.parse(l(r));A(i,""),e.onChange({...x,id:e.value.id})}catch(x){A(i,x.message,!0)}}gt(()=>{A(r,JSON.stringify(l(t),null,2),!0)});var s=ZT(),a=_(s),u=_(a),c=_(u),d=T(u,2),f=_(d),g=T(f,2),p=T(g,2),v=T(a,2);let m;var h=T(v,2);{var w=x=>{var S=YT(),k=_(S);J(()=>$(k,l(i))),y(x,S)};K(h,x=>{l(i)&&x(w)})}var b=T(h,2);J(()=>{$(c,e.title),f.disabled=!e.canMoveUp,g.disabled=!e.canMoveDown,m=Ee(v,1,"svelte-13ec6kv",null,m,{error:!!l(i)})}),ee("click",f,function(...x){e.onMoveUp?.apply(this,x)}),ee("click",g,function(...x){e.onMoveDown?.apply(this,x)}),ee("click",p,function(...x){e.onDelete?.apply(this,x)}),Mt(v,()=>l(r),x=>A(r,x)),ee("click",b,o),y(n,s),ve()}ye(["click"]);var XT=P('<label class="svelte-c5uqx8"> </label>'),QT=P('<div class="array-field svelte-c5uqx8"><!> <!> <button type="button"> </button></div>');function $T(n,e){he(e,!0);const t=z(()=>Array.isArray(e.value)?e.value:[]),r=z(()=>e.field.labels?.singular??"Item");function i(){return crypto.randomUUID()}function o(){e.onChange([...l(t),{id:i()}])}function s(h,w){const b=[...l(t)];b[h]=w,e.onChange(b)}function a(h){e.onChange(l(t).filter((w,b)=>b!==h))}function u(h){if(h===0)return;const w=[...l(t)];[w[h-1],w[h]]=[w[h],w[h-1]],e.onChange(w)}function c(h){if(h===l(t).length-1)return;const w=[...l(t)];[w[h],w[h+1]]=[w[h+1],w[h]],e.onChange(w)}var d=QT(),f=_(d);{var g=h=>{var w=XT(),b=_(w);J(()=>$(b,e.field.label)),y(h,w)};K(f,h=>{e.field.label&&h(g)})}var p=T(f,2);Ue(p,19,()=>l(t),h=>h.id,(h,w,b)=>{{let x=z(()=>l(r)),S=z(()=>l(b)+1),k=z(()=>l(b)>0),C=z(()=>l(b)<l(t).length-1);Fp(h,{get title(){return`${l(x)??""} #${l(S)??""}`},get value(){return l(w)},get canMoveUp(){return l(k)},get canMoveDown(){return l(C)},onChange:N=>s(l(b),N),onMoveUp:()=>u(l(b)),onMoveDown:()=>c(l(b)),onDelete:()=>a(l(b))})}});var v=T(p,2),m=_(v);J(()=>$(m,`+ Add ${l(r)??""}`)),ee("click",v,o),y(n,d),ve()}ye(["click"]);var eE=P('<label class="svelte-12ogf0n"> </label>'),tE=P("<option> </option>"),nE=P('<div class="blocks-field svelte-12ogf0n"><!> <!> <div class="add-bar svelte-12ogf0n"><select></select> <button type="button">+ Add Block</button></div></div>');function rE(n,e){he(e,!0);const t=z(()=>Array.isArray(e.value)?e.value:[]);let r=Q(We(e.field.blocks[0]?.slug??""));function i(){return crypto.randomUUID()}function o(b){return{id:i(),blockType:b}}function s(){l(r)&&e.onChange([...l(t),o(l(r))])}function a(b,x){const S=[...l(t)];S[b]=x,e.onChange(S)}function u(b){e.onChange(l(t).filter((x,S)=>S!==b))}function c(b){if(b===0)return;const x=[...l(t)];[x[b-1],x[b]]=[x[b],x[b-1]],e.onChange(x)}function d(b){if(b===l(t).length-1)return;const x=[...l(t)];[x[b],x[b+1]]=[x[b+1],x[b]],e.onChange(x)}var f=nE(),g=_(f);{var p=b=>{var x=eE(),S=_(x);J(()=>$(S,e.field.label)),y(b,x)};K(g,b=>{e.field.label&&b(p)})}var v=T(g,2);Ue(v,19,()=>l(t),b=>b.id,(b,x,S)=>{{let k=z(()=>l(S)+1),C=z(()=>l(x).blockType??"?"),N=z(()=>l(S)>0),O=z(()=>l(S)<l(t).length-1);Fp(b,{get title(){return`Block #${l(k)??""} · ${l(C)??""}`},get value(){return l(x)},get canMoveUp(){return l(N)},get canMoveDown(){return l(O)},onChange:E=>a(l(S),E),onMoveUp:()=>c(l(S)),onMoveDown:()=>d(l(S)),onDelete:()=>u(l(S))})}});var m=T(v,2),h=_(m);Ue(h,21,()=>e.field.blocks,ut,(b,x)=>{var S=tE(),k=_(S),C={};J(()=>{$(k,l(x).label),C!==(C=l(x).slug)&&(S.value=(S.__value=l(x).slug)??"")}),y(b,S)});var w=T(h,2);ah(h,()=>l(r),b=>A(r,b)),ee("click",w,s),y(n,f),ve()}ye(["click"]);var iE=P('<span class="text-destructive">*</span>'),oE=P('<p class="mt-1 text-xs text-destructive"> </p>'),sE=P('<div><label class="mb-1.5 block text-sm font-medium"> <!></label> <input type="password" autocomplete="new-password" placeholder="leave empty to keep unchanged"/> <!></div>');function aE(n,e){he(e,!0);let t=se(e,"value",15);var r=sE(),i=_(r),o=_(i),s=T(o);{var a=f=>{var g=iE();y(f,g)};K(s,f=>{e.field.required&&f(a)})}var u=T(i,2),c=T(u,2);{var d=f=>{var g=oE(),p=_(g);J(()=>$(p,e.error)),y(f,g)};K(c,f=>{e.error&&f(d)})}J(()=>{X(i,"for",e.field.name),$(o,`${e.field.label??""} `),X(u,"id",e.field.name),X(u,"name",e.field.name),Ee(u,1,`h-10 w-full rounded-md border bg-background px-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${e.error?"border-destructive":""}`),X(u,"minlength",e.field.minLength),X(u,"maxlength",e.field.maxLength)}),Mt(u,t),y(n,r),ve()}const Lp={text:sl,textarea:W1,number:J1,email:Z1,select:tw,checkbox:iw,date:lw,richtext:LC,relationship:$C,file:lT,upload:ET,slug:OT,color:LT,json:WT,tags:GT,array:$T,blocks:rE,url:sl,uuid:sl};function Ic(n){return n.type==="text"&&n.variant==="password"?aE:Lp[n.type]}var lE=P('<button type="button"> </button>'),uE=P('<div class="text-xs text-muted-foreground"> </div>'),cE=P('<div class="rounded-lg border border-border/60 bg-card"><div class="flex border-b border-border/60"></div> <div class="space-y-4 p-4"><!></div></div>');function dE(n,e){he(e,!0);let t=se(e,"formData",31,()=>We({})),r=se(e,"errors",19,()=>({})),i=Q(0);var o=cE(),s=_(o);Ue(s,21,()=>e.field.tabs,ut,(f,g,p)=>{var v=lE(),m=_(v);J(()=>{Ee(v,1,`px-4 py-2.5 text-sm font-medium transition-colors ${l(i)===p?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`),$(m,l(g).label)}),ee("click",v,()=>A(i,p,!0)),y(f,v)});var a=T(s,2),u=_(a);{var c=f=>{var g=ne(),p=q(g);It(p,()=>e.children),y(f,g)},d=f=>{var g=ne(),p=q(g);Ue(p,17,()=>e.field.tabs[l(i)].fields,v=>v.name,(v,m)=>{const h=z(()=>Ic(l(m)));var w=ne(),b=q(w);{var x=k=>{var C=ne(),N=q(C);Qt(N,()=>l(h),(O,E)=>{E(O,{get field(){return l(m)},get error(){return r()[l(m).name]},get value(){return t()[l(m).name]},set value(D){t(t()[l(m).name]=D,!0)}})}),y(k,C)},S=k=>{var C=uE(),N=_(C);J(()=>$(N,`Unsupported field type: ${l(m).type??""}`)),y(k,C)};K(b,k=>{l(h)?k(x):k(S,-1)})}y(v,w)}),y(f,g)};K(u,f=>{e.children?f(c):e.field.tabs[l(i)]&&f(d,1)})}y(n,o),ve()}ye(["click"]);Lp.tabs=dE;var fE=P('<p class="text-sm text-muted-foreground"> </p>'),gE=P('<div class="grid gap-4"></div>'),hE=P('<div class="grid gap-4"></div>'),vE=P('<div class="space-y-6"></div>');function Rp(n,e){he(e,!0);const t=(p,v=Nt)=>{const m=z(()=>Ic(v()));var h=ne(),w=q(h);{var b=S=>{var k=ne(),C=q(k);Qt(C,()=>l(m),(N,O)=>{O(N,{get field(){return v()},get error(){return l(f)[v().name]},get formData(){return a()},get value(){return a()[v().name]},set value(E){a(a()[v().name]=E,!0)}})}),y(S,k)},x=S=>{var k=fE(),C=_(k);J(()=>$(C,`Unknown field type: ${v().type??""}`)),y(S,k)};K(w,S=>{l(m)?S(b):S(x,-1)})}y(p,h)};se(e,"initialData",19,()=>({}));let r=se(e,"errors",19,()=>({})),i=se(e,"sidebarFields",19,()=>[]),o=se(e,"tabsField",3,void 0),s=se(e,"activeTab",3,0),a=se(e,"formData",31,()=>We({})),u=z(()=>new Set(i())),c=z(()=>e.fields.filter(p=>!p.hidden&&!l(u).has(p.name))),d=We({}),f=z(()=>({...r(),...d}));var g=vE();Ue(g,23,()=>l(c),(p,v)=>p.name||`${p.type}-${v}`,(p,v)=>{var m=ne(),h=q(m);{var w=S=>{var k=ne(),C=q(k);{var N=O=>{var E=ne(),D=q(E);Ue(D,17,()=>o().tabs[s()].fields??[],L=>L.name,(L,V)=>{var G=ne(),U=q(G);{var M=Y=>{var Z=gE();Ue(Z,21,()=>(l(V).fields??[]).filter(W=>!W.hidden),W=>W.name,(W,H)=>{t(W,()=>l(H))}),J(()=>zn(Z,`grid-template-columns: repeat(${(l(V).fields??[]).length??""}, minmax(0, 1fr));`)),y(Y,Z)},j=Y=>{t(Y,()=>l(V))};K(U,Y=>{l(V).type==="row"?Y(M):Y(j,-1)})}y(L,G)}),y(O,E)};K(C,O=>{o()&&o().tabs&&o().tabs[s()]&&O(N)})}y(S,k)},b=S=>{var k=hE();Ue(k,21,()=>(l(v).fields??[]).filter(C=>!C.hidden),C=>C.name,(C,N)=>{t(C,()=>l(N))}),J(()=>zn(k,`grid-template-columns: repeat(${(l(v).fields??[]).length??""}, minmax(0, 1fr));`)),y(S,k)},x=S=>{t(S,()=>l(v))};K(h,S=>{l(v).type==="tabs"?S(w):l(v).type==="row"?S(b,1):S(x,-1)})}y(p,m)}),y(n,g),ve()}function zp(n,e){if(n===e)return!0;if(typeof n!=typeof e||n===null||e===null||typeof n!="object")return!1;const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const i of t)if(!zp(n[i],e[i]))return!1;return!0}function pE(n,e){const t=z(()=>!zp(n(),e()));let r=!1;return _t(()=>{function i(o){!l(t)||r||(o.preventDefault(),o.returnValue="")}return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)}),jb(({cancel:i})=>{r||l(t)&&!confirm("You have unsaved changes. Leave anyway?")&&i()}),{get isDirty(){return l(t)},allowNavigation(){r=!0}}}var mE=P('<aside class="space-y-5 lg:sticky lg:top-[260px] lg:self-start"><!> <!></aside>'),_E=P('<div><div class="min-w-0"><!></div> <!></div>'),bE=P("<!> <!> <!>",1);function Bp(n,e){he(e,!0);const t=F=>{var R=ne(),B=q(R);{var re=le=>{{let ke=z(()=>e.collection.versions?.drafts?.autosave?.interval??2e3);_1(le,{get collectionKey(){return e.collection.key},get recordId(){return r().id},get formData(){return l(u)},get interval(){return l(ke)}})}};K(B,le=>{l(h)&&l(f)==="edit"&&r()?.id&&le(re)})}y(F,R)};let r=se(e,"record",7,null),i=se(e,"isSubmitting",3,!1),o=se(e,"errors",19,()=>({}));function s(F){const R=[];for(const B of F){if(B.type==="tabs"){const re=B.tabs??[];for(const le of re)R.push(...s(le.fields??[]));continue}if(B.type==="row"){R.push(...s(B.fields??[]));continue}R.push(B)}return R}function a(F,R){const B={};for(const re of s(F))if(R[re.name]!==void 0&&R[re.name]!==null){let le=R[re.name];if(re.type==="tags"&&typeof le=="string")try{le=JSON.parse(le)}catch{le=[]}B[re.name]=le}else re.defaultValue!==void 0?B[re.name]=re.defaultValue:re.type==="checkbox"?B[re.name]=!1:re.type==="tags"?B[re.name]=[]:re.type==="number"||re.type==="file"||re.type==="relationship"||re.type==="richtext"?B[re.name]=null:B[re.name]="";return B}let u=Q(We(a(e.collection.fields,r()??{}))),c=Q(We(a(e.collection.fields,r()??{}))),d=Q(We(r()?.id??"__new__")),f=Q("edit");function g(F){A(f,F,!0)}gt(()=>{const F=r()?.id??"__new__";l(d)!==F&&(A(u,a(e.collection.fields,r()??{}),!0),A(c,a(e.collection.fields,r()??{}),!0),A(d,F,!0))});const p=pE(()=>l(u),()=>l(c));let v=z(()=>{const F=e.collection.admin?.useAsTitle;return F&&l(u)[F]?String(l(u)[F]):e.mode==="create"?`New ${e.collection.label}`:r()?.id??e.collection.label}),m=z(()=>e.collection.versions?.drafts!=null),h=z(()=>e.collection.versions?.drafts?.autosave!=null),w=z(()=>e.collection.versions?.drafts?.schedulePublish===!0),b=Q(!1),x=Q(!1),S=z(()=>l(u)._status??r()?._status??"draft"),k=z(()=>l(m)?e.mode==="create"?l(S)==="published"?"Publish":"Create draft":l(S)==="published"?"Publish changes":"Save draft":(e.mode==="create","Save")),C=z(()=>e.collection.fields.find(F=>F.type==="tabs")),N=z(()=>l(C)?(l(C).tabs??[]).map(F=>({label:F.label})):[]),O=Q(0),E=z(()=>e.collection.admin?.sidebarFields??[]),D=z(()=>new Set(l(E))),L=z(()=>e.collection.fields.filter(F=>!F.hidden&&l(D).has(F.name)));function V(){const F={};for(const R of Object.keys(l(u))){const B=l(u)[R];B==null||B===""||(F[R]=B)}A(c,{...l(u)},!0),p.allowNavigation(),e.onSave(F)}function G(F){l(m)&&(l(u)._status=F),V()}async function U(){if(!r()?.id)return;const F=await r0(e.collection.key,r().id);F.ok?(l(u)._status="draft",A(c,{...l(u)},!0),r(F.data),Ke.success("Record unpublished")):Ke.error(F.error)}function M(){A(b,!0)}function j(F){A(x,!0),l(u).publishAt=F,l(u)._status="draft",A(b,!1);try{V(),Ke.success(`Scheduled to publish at ${new Date(F).toLocaleString()}`)}finally{A(x,!1)}}var Y=bE(),Z=q(Y);p1(Z,{get collection(){return e.collection},get liveTitle(){return l(v)},get record(){return r()},get mode(){return e.mode},get status(){return l(S)},get saveLabel(){return l(k)},get isDirty(){return p.isDirty},get isSubmitting(){return i()},onSave:V,onSaveAs:G,onUnpublish:U,onSchedule:M,get tabs(){return l(N)},get headerMode(){return l(f)},setHeaderMode:g,get hasDrafts(){return l(m)},get hasSchedulePublish(){return l(w)},get metaExtra(){return t},get activeTab(){return l(O)},set activeTab(F){A(O,F,!0)}});var W=T(Z,2);{let F=z(()=>l(u).publishAt??"");I1(W,{get initialValue(){return l(F)},get isSubmitting(){return l(x)},onSchedule:j,get open(){return l(b)},set open(R){A(b,R,!0)}})}var H=T(W,2);{var ie=F=>{{let R=z(()=>r()?.id??null);A1(F,{get collectionKey(){return e.collection.key},get recordId(){return l(R)},get mode(){return e.mode},onApply:()=>A(f,"edit"),get formData(){return l(u)},set formData(B){A(u,B,!0)}})}},I=F=>{var R=_E(),B=_(R),re=_(B);{let Ae=z(()=>r()??{});Rp(re,{get fields(){return e.collection.fields},get initialData(){return l(Ae)},get errors(){return o()},get sidebarFields(){return l(E)},get tabsField(){return l(C)},get activeTab(){return l(O)},get formData(){return l(u)},set formData(we){A(u,we,!0)}})}var le=T(B,2);{var ke=Ae=>{var we=mE(),_e=_(we);Ue(_e,17,()=>l(L),Fe=>Fe.name,(Fe,ge)=>{const Ve=z(()=>Ic(l(ge)));var He=ne(),tt=q(He);{var rt=Ie=>{var ze=ne(),fe=q(ze);Qt(fe,()=>l(Ve),(te,ae)=>{ae(te,{get field(){return l(ge)},get error(){return o()[l(ge).name]},get formData(){return l(u)},get value(){return l(u)[l(ge).name]},set value(me){l(u)[l(ge).name]=me}})}),y(Ie,ze)};K(tt,Ie=>{l(Ve)&&Ie(rt)})}y(Fe,He)});var Ce=T(_e,2);{var xe=Fe=>{P1(Fe,{get collectionKey(){return e.collection.key},get recordId(){return r().id}})};K(Ce,Fe=>{e.collection.versions&&e.mode==="edit"&&r()?.id&&Fe(xe)})}y(Ae,we)};K(le,Ae=>{(l(L).length>0||e.collection.versions&&e.mode==="edit"&&r()?.id)&&Ae(ke)})}J(()=>Ee(R,1,`grid gap-9 px-7 py-8 ${l(L).length>0||e.collection.versions&&e.mode==="edit"&&r()?.id?"lg:grid-cols-[1fr_320px]":""}`)),y(F,R)};K(H,F=>{l(f)==="api"?F(ie):F(I,-1)})}y(n,Y),ve()}var yE=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),xE=P('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Creating draft...</p></div></div>');function wE(n,e){he(e,!0);let t=z(()=>_n.params.collection??""),r=z(()=>vo(hn.collections,l(t))),i=Q(!1),o=Q(We({})),s=Q(!1);_t(async()=>{if(!l(r))return;if(l(r).versions?.drafts?.autosave!=null){A(s,!0);const v=await Jl(l(t),{_status:"draft"},{draft:!0});A(s,!1),v.ok&&v.data.id&&await En(Ye(`/${l(t)}/${v.data.id}`),{})}});async function a(p){if(!l(r))return;A(i,!0),A(o,{},!0);const v=p._status==="draft",m=await Jl(l(t),p,{draft:v});A(i,!1),m.ok?(Ke.success("Record created"),await En(Ye(`/${l(t)}/${m.data.id}`))):(m.details&&A(o,m.details,!0),Ke.error(m.error))}var u=ne(),c=q(u);{var d=p=>{var v=yE();y(p,v)},f=p=>{var v=xE();y(p,v)},g=p=>{Bp(p,{get collection(){return l(r)},mode:"create",get isSubmitting(){return l(i)},get errors(){return l(o)},onSave:a})};K(c,p=>{l(r)?l(s)?p(f,1):p(g,-1):p(d)})}y(n,u),ve()}var kE=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),SE=P('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),CE=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Record not found</p></div>'),TE=P('<div class="border-b border-amber-200 bg-amber-50 px-7 py-2.5 text-sm text-amber-800">This document is being edited by <strong> </strong>. Your changes may be overwritten.</div>'),EE=P("<!> <!> <!>",1);function NE(n,e){he(e,!0);let t=z(()=>_n.params.collection??""),r=z(()=>_n.params.id??""),i=z(()=>vo(hn.collections,l(t))),o=Q(null),s=Q(!0),a=Q(!1),u=Q(We({})),c=Q(!1),d=Q(!1),f=Q(null),g;_t(async()=>{const k=l(i)?.versions?.drafts!=null,C=await ea(l(t),l(r),"*",{draft:k});if(A(s,!1),C.ok){A(o,C.data,!0);const N=await od(l(t),l(r));N.ok&&N.data.locked&&N.data.lock&&A(f,{userName:N.data.lock.userName},!0),g=setInterval(async()=>{await od(l(t),l(r))},120*1e3)}else Ke.error(C.error)}),z_(()=>{g&&clearInterval(g),i0(l(t),l(r))});async function p(k){A(a,!0),A(u,{},!0);const C=k._status==="draft",N=await Nh(l(t),l(r),k,{draft:C});A(a,!1),N.ok?(A(o,N.data,!0),Ke.success("Record updated")):(N.details&&A(u,N.details,!0),Ke.error(N.error))}async function v(){A(d,!0);const k=await Ah(l(t),l(r));A(d,!1),A(c,!1),k.ok?(Ke.success("Record deleted"),await En(Ye(`/${l(t)}`))):Ke.error(k.error)}var m=ne(),h=q(m);{var w=k=>{var C=kE();y(k,C)},b=k=>{var C=SE();y(k,C)},x=k=>{var C=CE();y(k,C)},S=k=>{var C=EE(),N=q(C);{var O=L=>{var V=TE(),G=T(_(V)),U=_(G);J(()=>$(U,l(f).userName)),y(L,V)};K(N,L=>{l(f)&&L(O)})}var E=T(N,2);Bp(E,{get collection(){return l(i)},get record(){return l(o)},mode:"edit",get isSubmitting(){return l(a)},get errors(){return l(u)},onSave:p});var D=T(E,2);Ph(D,{get title(){return`Delete ${l(i).label??""}`},description:"Are you sure you want to delete this record? This action cannot be undone.",get isDeleting(){return l(d)},onConfirm:v,get open(){return l(c)},set open(L){A(c,L,!0)}}),y(k,C)};K(h,k=>{l(i)?l(s)?k(b,1):l(o)?k(S,-1):k(x,2):k(w)})}y(n,m),ve()}function Up(n,e,t){const r=new URLSearchParams;t?.page&&r.set("page",String(t.page)),t?.limit&&r.set("limit",String(t.limit));const i=r.toString()?`?${r.toString()}`:"";return Wr(`/collections/${n}/records/${e}/versions${i}`)}function og(n,e,t){return Wr(`/collections/${n}/records/${e}/versions/${t}`)}function jp(n,e,t,r=!0){return xi(`/collections/${n}/records/${e}/versions/${t}/restore?draft=${r}`,{})}var AE=P("<span> </span>");function ku(n,e){let t=se(e,"status",3,""),r=se(e,"isLatest",3,!1),i=z(()=>t()==="draft"&&r()?"Current Draft":t()==="draft"?"Draft":t()==="published"&&r()?"Published":t()==="published"?"Previously Published":t()||""),o=z(()=>t()==="draft"&&r()?"bg-amber-100 text-amber-800":t()==="published"&&r()?"bg-green-100 text-green-800":"bg-stone-100 text-stone-600");var s=ne(),a=q(s);{var u=c=>{var d=AE(),f=_(d);J(()=>{Ee(d,1,`rounded-full px-2 py-0.5 text-[10px] font-semibold ${l(o)??""}`),$(f,l(i))}),y(c,d)};K(a,c=>{l(i)&&c(u)})}y(n,s)}var ME=P('<label class="mt-4 flex items-center gap-2 text-sm text-stone-700"><input type="checkbox" class="rounded"/> Restore as published</label>'),PE=P('<div class="fixed inset-0 z-50 flex items-center justify-center"><button class="absolute inset-0 bg-black/50" aria-label="Close modal"></button> <div class="relative z-10 w-full max-w-md rounded-lg bg-white p-6 shadow-xl"><h3 class="text-lg font-semibold text-stone-900">Restore Version</h3> <p class="mt-2 text-sm text-stone-600">This will replace current record data with data from this version.</p> <!> <div class="mt-6 flex justify-end gap-3"><button class="rounded-md px-4 py-2 text-sm font-medium text-stone-700 hover:bg-stone-100">Cancel</button> <button class="rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50"> </button></div></div></div>');function Wp(n,e){he(e,!0);let t=se(e,"open",15,!1),r=Q(!1);function i(){e.onRestore(!l(r))}function o(){t(!1),A(r,!1)}var s=ne(),a=q(s);{var u=c=>{var d=PE(),f=_(d),g=T(f,2),p=T(_(g),4);{var v=x=>{var S=ME(),k=_(S);Hu(k,()=>l(r),C=>A(r,C)),y(x,S)};K(p,x=>{e.hasDrafts&&x(v)})}var m=T(p,2),h=_(m),w=T(h,2),b=_(w);J(()=>{h.disabled=e.isRestoring,w.disabled=e.isRestoring,$(b,e.isRestoring?"Restoring...":"Restore")}),ee("click",f,o),ee("click",h,o),ee("click",w,i),y(c,d)};K(a,c=>{t()&&c(u)})}y(n,s),ve()}ye(["click"]);var OE=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),DE=P('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),IE=P('<div class="flex flex-col items-center justify-center py-16"><p class="text-sm text-muted-foreground">No versions found</p></div>'),FE=P('<tr class="border-b border-border/40 transition-colors hover:bg-secondary/30"><td class="px-4 py-2.5"><a class="text-primary hover:underline"> </a></td><td class="px-4 py-2.5"><!></td><td class="px-4 py-2.5 text-muted-foreground"> </td><td class="px-4 py-2.5 text-right"><button type="button" class="inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground" title="Restore this version"><!></button></td></tr>'),LE=P('<!> <div class="overflow-x-auto rounded-lg border border-border/80 bg-card shadow-sm"><table class="w-full text-sm"><thead><tr class="border-b border-border/60 bg-secondary/40"><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Date</th><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Status</th><th class="px-4 py-2.5 text-left font-medium text-muted-foreground">Age</th><th class="px-4 py-2.5 text-right font-medium text-muted-foreground">Actions</th></tr></thead><tbody></tbody></table></div> <!>',1),RE=P('<div class="space-y-5"><nav class="flex items-center gap-1.5 text-sm text-muted-foreground"><a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground"> </a> <span>/</span> <span class="text-foreground font-medium">Versions</span></nav> <h1 class="text-xl font-semibold text-foreground">Version History</h1> <!></div> <!>',1);function zE(n,e){he(e,!0);let t=z(()=>_n.params.collection??""),r=z(()=>_n.params.id??""),i=z(()=>vo(hn.collections,l(t))),o=Q(We([])),s=Q(!0),a=Q(1),u=20,c=Q(0),d=Q(!1),f=Q(""),g=Q(!1),p=z(()=>Math.max(1,Math.ceil(l(c)/u))),v=z(()=>l(o).find(G=>G._status==="published"&&G.latest)?.id??l(o).find(G=>G._status==="published")?.id??""),m=z(()=>l(o).find(G=>G._status==="draft"&&G.latest)?.id??""),h=z(()=>l(i)?.versions?.drafts!=null);async function w(V){A(s,!0);const G=await Up(l(t),l(r),{page:V,limit:u});A(s,!1),G.ok?(A(o,G.data.versions??[],!0),A(c,G.data.totalRecords??0,!0),A(a,V,!0)):Ke.error(G.error)}_t(()=>{w(1)});function b(V){return V?new Date(V).toLocaleString():""}function x(V){if(!V)return"";const G=Date.now()-new Date(V).getTime(),U=Math.floor(G/1e3);if(U<60)return`${U}s ago`;const M=Math.floor(U/60);if(M<60)return`${M}m ago`;const j=Math.floor(M/60);return j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`}function S(V){A(f,V,!0),A(d,!0)}async function k(V){A(g,!0);const G=await jp(l(t),l(r),l(f),V);A(g,!1),A(d,!1),G.ok?(Ke.success("Version restored"),await En(Ye(`/${l(t)}/${l(r)}`))):Ke.error(G.error)}function C(V){w(V)}var N=ne(),O=q(N);{var E=V=>{var G=OE();y(V,G)},D=V=>{var G=DE();y(V,G)},L=V=>{var G=RE(),U=q(G),M=_(U),j=_(M),Y=_(j),Z=T(j,4),W=_(Z),H=T(M,4);{var ie=R=>{var B=IE();y(R,B)},I=R=>{var B=LE(),re=q(B);na(re,{get page(){return l(a)},get totalPages(){return l(p)},get totalRecords(){return l(c)},perPage:u,onPageChange:C,class:"border-b border-border/60"});var le=T(re,2),ke=_(le),Ae=T(_(ke));Ue(Ae,21,()=>l(o),_e=>_e.id,(_e,Ce)=>{var xe=FE(),Fe=_(xe),ge=_(Fe),Ve=_(ge),He=T(Fe),tt=_(He);{let ae=z(()=>l(Ce)._status??""),me=z(()=>l(Ce).id===l(v)||l(Ce).id===l(m));ku(tt,{get status(){return l(ae)},get isLatest(){return l(me)}})}var rt=T(He),Ie=_(rt),ze=T(rt),fe=_(ze),te=_(fe);Iy(te,{class:"h-4 w-4"}),J((ae,me,ce)=>{X(ge,"href",ae),$(Ve,me),$(Ie,ce)},[()=>Ye(`/${l(t)}/${l(r)}/versions/${l(Ce).id}`),()=>b(l(Ce).createdAt),()=>x(l(Ce).createdAt)]),ee("click",fe,()=>S(l(Ce).id)),y(_e,xe)});var we=T(le,2);na(we,{get page(){return l(a)},get totalPages(){return l(p)},get totalRecords(){return l(c)},perPage:u,onPageChange:C}),y(R,B)};K(H,R=>{l(o).length===0?R(ie):R(I,-1)})}var F=T(U,2);Wp(F,{get hasDrafts(){return l(h)},get isRestoring(){return l(g)},onRestore:k,get open(){return l(d)},set open(R){A(d,R,!0)}}),J((R,B)=>{X(j,"href",R),$(Y,l(i).labelPlural||l(i).label),X(Z,"href",B),$(W,l(r))},[()=>Ye(`/${l(t)}`),()=>Ye(`/${l(t)}/${l(r)}`)]),y(V,G)};K(O,V=>{l(i)?l(s)?V(D,1):V(L,-1):V(E)})}y(n,N),ve()}ye(["click"]);function BE(n,e){return n===e||n==null&&e==null?!0:n==null||e==null?!1:typeof n=="object"&&typeof e=="object"?JSON.stringify(n)===JSON.stringify(e):!1}function Su(n){if(n==null)return"";if(typeof n=="boolean")return n?"true":"false";if(Array.isArray(n))return n.join(", ");if(typeof n=="string"&&n.startsWith("{"))try{const e=JSON.parse(n);return Su(e)}catch{return n}if(typeof n=="object"){const e=n;return e.root&&e.root.children?Kp(e.root.children):e.url&&e.filename?e.filename:e.url?e.url:JSON.stringify(n,null,2)}return String(n)}function Kp(n){const e=[];for(const t of n)if(t.text)e.push(t.text);else if(t.children){const r=Kp(t.children);r&&e.push(r)}return e.join(`
|
|
33
|
-
`)}function sg(n){return n.match(/\S+|\s+/g)??[]}function UE(n,e){const t=sg(n),r=sg(e),i=t.length,o=r.length,s=Array.from({length:i+1},()=>Array(o+1).fill(0));for(let f=1;f<=i;f++)for(let g=1;g<=o;g++)t[f-1]===r[g-1]?s[f][g]=s[f-1][g-1]+1:s[f][g]=Math.max(s[f-1][g],s[f][g-1]);const a=[];let u=i,c=o;const d=[];for(;u>0||c>0;)u>0&&c>0&&t[u-1]===r[c-1]?(d.push({type:"equal",value:t[u-1]}),u--,c--):c>0&&(u===0||s[u][c-1]>=s[u-1][c])?(d.push({type:"add",value:r[c-1]}),c--):(d.push({type:"delete",value:t[u-1]}),u--);d.reverse();for(const f of d)a.length>0&&a[a.length-1].type===f.type?a[a.length-1].value+=f.value:a.push({...f});return a}var jE=P('<img alt="old" class="h-16 w-16 rounded object-cover"/>'),WE=P('<span class="text-xs text-stone-400">No file</span>'),KE=P('<img alt="new" class="h-16 w-16 rounded object-cover"/>'),HE=P('<span class="text-xs text-stone-400">No file</span>'),VE=P('<div class="grid grid-cols-[1fr_auto_1fr] items-center gap-0"><div class="p-3"><!></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3"><!></div></div>'),JE=P('<div class="grid grid-cols-[1fr_auto_1fr] items-center gap-0"><div class="p-3"><span> </span></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3"><span> </span></div></div>'),qE=P("<span> </span>"),GE=P('<span class="bg-red-100 line-through"> </span>'),YE=P("<span> </span>"),ZE=P('<span class="bg-green-100"> </span>'),XE=P('<div class="mt-2 grid grid-cols-[1fr_auto_1fr] gap-0"><div class="p-2 text-sm leading-relaxed"></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-2 text-sm leading-relaxed"></div></div>'),QE=P('<div class="px-3 py-2"><button class="flex items-center gap-1 text-xs text-stone-600 hover:text-stone-900"><!> <span class="rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium text-amber-700">content changed</span></button> <!></div>'),$E=P("<span> </span>"),eN=P('<span class="bg-red-100 line-through"> </span>'),tN=P("<span> </span>"),nN=P('<span class="bg-green-100"> </span>'),rN=P('<div class="grid grid-cols-[1fr_auto_1fr] gap-0"><div class="p-3 text-sm leading-relaxed"></div> <div class="w-px self-stretch bg-stone-200"></div> <div class="p-3 text-sm leading-relaxed"></div></div>'),iN=P('<div class="border-b border-stone-200"><div class="bg-stone-50 px-3 py-1.5"><span class="text-[11px] font-semibold uppercase tracking-wide text-stone-500"> </span></div> <!></div>');function oN(n,e){he(e,!0);let t=se(e,"fieldType",3,"text"),r=Q(!1),i=z(()=>BE(e.oldValue,e.newValue)),o=z(()=>Su(e.oldValue)),s=z(()=>Su(e.newValue)),a=z(()=>UE(l(o),l(s)));var u=ne(),c=q(u);{var d=f=>{var g=iN(),p=_(g),v=_(p),m=_(v),h=T(p,2);{var w=k=>{var C=VE(),N=_(C),O=_(N);{var E=M=>{var j=jE();J(()=>X(j,"src",l(o))),y(M,j)},D=M=>{var j=WE();y(M,j)};K(O,M=>{l(o)?M(E):M(D,-1)})}var L=T(N,4),V=_(L);{var G=M=>{var j=KE();J(()=>X(j,"src",l(s))),y(M,j)},U=M=>{var j=HE();y(M,j)};K(V,M=>{l(s)?M(G):M(U,-1)})}y(k,C)},b=k=>{var C=JE(),N=_(C),O=_(N),E=_(O),D=T(N,4),L=_(D),V=_(L);J(()=>{Ee(O,1,`rounded-full px-2 py-0.5 text-xs font-medium ${l(o)==="true"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`),$(E,l(o)),Ee(L,1,`rounded-full px-2 py-0.5 text-xs font-medium ${l(s)==="true"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`),$(V,l(s))}),y(k,C)},x=k=>{var C=QE(),N=_(C),O=_(N);{var E=G=>{Ta(G,{size:14})},D=G=>{Vu(G,{size:14})};K(O,G=>{l(r)?G(E):G(D,-1)})}var L=T(N,2);{var V=G=>{var U=XE(),M=_(U);Ue(M,21,()=>l(a),ut,(Y,Z)=>{var W=ne(),H=q(W);{var ie=F=>{var R=qE(),B=_(R);J(()=>$(B,l(Z).value)),y(F,R)},I=F=>{var R=GE(),B=_(R);J(()=>$(B,l(Z).value)),y(F,R)};K(H,F=>{l(Z).type==="equal"?F(ie):l(Z).type==="delete"&&F(I,1)})}y(Y,W)});var j=T(M,4);Ue(j,21,()=>l(a),ut,(Y,Z)=>{var W=ne(),H=q(W);{var ie=F=>{var R=YE(),B=_(R);J(()=>$(B,l(Z).value)),y(F,R)},I=F=>{var R=ZE(),B=_(R);J(()=>$(B,l(Z).value)),y(F,R)};K(H,F=>{l(Z).type==="equal"?F(ie):l(Z).type==="add"&&F(I,1)})}y(Y,W)}),y(G,U)};K(L,G=>{l(r)&&G(V)})}ee("click",N,()=>A(r,!l(r))),y(k,C)},S=k=>{var C=rN(),N=_(C);Ue(N,21,()=>l(a),ut,(E,D)=>{var L=ne(),V=q(L);{var G=M=>{var j=$E(),Y=_(j);J(()=>$(Y,l(D).value)),y(M,j)},U=M=>{var j=eN(),Y=_(j);J(()=>$(Y,l(D).value)),y(M,j)};K(V,M=>{l(D).type==="equal"?M(G):l(D).type==="delete"&&M(U,1)})}y(E,L)});var O=T(N,4);Ue(O,21,()=>l(a),ut,(E,D)=>{var L=ne(),V=q(L);{var G=M=>{var j=tN(),Y=_(j);J(()=>$(Y,l(D).value)),y(M,j)},U=M=>{var j=nN(),Y=_(j);J(()=>$(Y,l(D).value)),y(M,j)};K(V,M=>{l(D).type==="equal"?M(G):l(D).type==="add"&&M(U,1)})}y(E,L)}),y(k,C)};K(h,k=>{t()==="file"||t()==="upload"?k(w):t()==="checkbox"?k(b,1):t()==="richtext"?k(x,2):k(S,-1)})}J(()=>$(m,e.fieldLabel||e.fieldName)),y(f,g)};K(c,f=>{l(i)||f(d)})}y(n,u),ve()}ye(["click"]);var sN=P("<option> </option>"),aN=P('<select class="rounded-md border border-stone-300 bg-white px-3 py-1.5 text-sm text-stone-700 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"></select>');function lN(n,e){he(e,!0);var t=aN();Ue(t,21,()=>e.options,ut,(i,o)=>{var s=sN(),a=_(s),u={};J(c=>{$(a,`${l(o).label??""} — ${c??""}`),u!==(u=l(o).id)&&(s.value=(s.__value=l(o).id)??"")},[()=>ta(l(o).date)]),y(i,s)});var r;Ku(t),J(()=>{r!==(r=e.selected)&&(t.value=(t.__value=e.selected)??"",Ko(t,e.selected))}),ee("change",t,i=>e.onChange(i.target.value)),y(n,t),ve()}ye(["change"]);var uN=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Collection not found</p></div>'),cN=P('<div class="flex h-full items-center justify-center"><div class="flex flex-col items-center gap-3"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin-slow"></div> <p class="text-sm text-muted-foreground">Loading...</p></div></div>'),dN=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Version not found</p></div>'),fN=P('<div class="flex flex-wrap items-center gap-2"><!> <!></div> <p class="text-xs text-muted-foreground"> </p>',1),gN=P('<p class="text-xs text-muted-foreground">No other version to compare</p>'),hN=P('<div class="flex flex-col items-center justify-center py-12"><p class="text-sm text-muted-foreground"> </p></div>'),vN=P('<div class="overflow-hidden rounded-lg border border-border/80 bg-card shadow-sm"></div>'),pN=P('<div class="space-y-5"><nav class="flex items-center gap-1.5 text-sm text-muted-foreground"><a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground"> </a> <span>/</span> <a class="hover:text-foreground">Versions</a> <span>/</span> <span class="text-foreground font-medium"> </span></nav> <div class="flex items-center justify-between"><h1 class="text-xl font-semibold text-foreground">Compare Versions</h1> <label class="flex items-center gap-2 text-sm text-muted-foreground"><input type="checkbox" class="rounded"/> Modified fields only</label></div> <div class="grid grid-cols-[1fr_auto_1fr] gap-0 rounded-lg border border-border/80 bg-card shadow-sm"><div class="p-4 space-y-2"><span class="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">Comparing Against</span> <!></div> <div class="w-px self-stretch bg-border/60"></div> <div class="p-4 space-y-2"><span class="text-[10px] font-semibold uppercase tracking-wide text-muted-foreground">Currently Viewing</span> <div class="flex flex-wrap items-center gap-2"><span class="text-sm font-medium text-foreground"> </span> <!></div> <div class="flex items-center gap-3"><p class="text-xs text-muted-foreground"> </p> <button type="button" class="text-xs font-medium text-primary hover:underline">Restore this version</button></div></div></div> <!></div> <!>',1);function mN(n,e){he(e,!0);let t=z(()=>_n.params.collection??""),r=z(()=>_n.params.id??""),i=z(()=>_n.params.vid??""),o=z(()=>vo(hn.collections,l(t))),s=Q(We([])),a=Q(null),u=Q(null),c=Q(!0),d=Q(!0),f=Q(!1),g=Q(!1),p=z(()=>l(o)?.versions?.drafts!=null),v=z(()=>N(l(a))),m=z(()=>N(l(u)));const h=["id","createdAt","updatedAt","_versionId","_versionCreatedAt"];function w(W){const H=[];for(const ie of W){if(ie.type==="tabs"){for(const I of ie.tabs??[])H.push(...w(I.fields??[]));continue}H.push(ie)}return H}let b=z(()=>l(o)?w(l(o).fields).filter(W=>!W.hidden&&!h.includes(W.name)):[]),x=z(()=>l(d)?l(b).filter(W=>{const H=l(m)[W.name],ie=l(v)[W.name];return JSON.stringify(H)!==JSON.stringify(ie)}):l(b)),S=z(()=>l(s).find(H=>H._status==="published"&&H.latest)?.id??l(s).find(H=>H._status==="published")?.id??""),k=z(()=>l(s).find(H=>H._status==="draft"&&H.latest)?.id??""),C=z(()=>{const W=l(s).find(ie=>ie._status==="published");let H=!1;return l(s).filter(ie=>ie.id!==l(i)).map(ie=>{let I;return ie.latest&&ie._status==="draft"?I="Current Draft":ie._status==="published"&&ie.id===W?.id?I="Currently Published":ie._status==="published"?I="Previously Published":H?I="Version":(I="Previous Version",H=!0),{id:ie.id,label:I,status:ie._status,isLatest:ie.id===l(S)||ie.id===l(k),date:ie.createdAt}})});function N(W){if(!W)return{};const H=W.version;if(!H)return{};if(typeof H=="string")try{return JSON.parse(H)}catch{return{}}return typeof H=="object"?H:{}}function O(W){return W?new Date(W).toLocaleString():""}function E(W){if(!W)return"";const H=Date.now()-new Date(W).getTime(),ie=Math.floor(H/1e3);if(ie<60)return`${ie}s ago`;const I=Math.floor(ie/60);if(I<60)return`${I}m ago`;const F=Math.floor(I/60);return F<24?`${F}h ago`:`${Math.floor(F/24)}d ago`}async function D(W){const H=await og(l(t),l(r),W);H.ok?A(u,H.data,!0):Ke.error(H.error)}function L(W){D(W)}_t(async()=>{const[W,H]=await Promise.all([Up(l(t),l(r),{page:1,limit:50}),og(l(t),l(r),l(i))]);if(!W.ok){A(c,!1),Ke.error(W.error);return}if(!H.ok){A(c,!1),Ke.error(H.error);return}A(s,W.data.versions??[],!0),A(a,H.data,!0);const ie=l(s).findIndex(F=>F.id===l(i)),I=ie>=0&&ie<l(s).length-1?l(s)[ie+1]:l(s).find(F=>F.id!==l(i));I&&await D(I.id),A(c,!1)});async function V(W){A(g,!0);const H=await jp(l(t),l(r),l(i),W);A(g,!1),A(f,!1),H.ok?(Ke.success("Version restored"),await En(Ye(`/${l(t)}/${l(r)}`))):Ke.error(H.error)}var G=ne(),U=q(G);{var M=W=>{var H=uN();y(W,H)},j=W=>{var H=cN();y(W,H)},Y=W=>{var H=dN();y(W,H)},Z=W=>{var H=pN(),ie=q(H),I=_(ie),F=_(I),R=_(F),B=T(F,4),re=_(B),le=T(B,4),ke=T(le,4),Ae=_(ke),we=T(I,2),_e=T(_(we),2),Ce=_(_e),xe=T(we,2),Fe=_(xe),ge=T(_(Fe),2);{var Ve=Ze=>{var it=fN(),$e=q(it),Je=_($e);lN(Je,{get options(){return l(C)},get selected(){return l(u).id},onChange:L});var ot=T(Je,2);{let Re=z(()=>l(u)._status??""),st=z(()=>l(u).id===l(S)||l(u).id===l(k));ku(ot,{get status(){return l(Re)},get isLatest(){return l(st)}})}var je=T($e,2),Ge=_(je);J(Re=>$(Ge,Re),[()=>E(l(u).createdAt)]),y(Ze,it)},He=Ze=>{var it=gN();y(Ze,it)};K(ge,Ze=>{l(u)?Ze(Ve):Ze(He,-1)})}var tt=T(Fe,4),rt=T(_(tt),2),Ie=_(rt),ze=_(Ie),fe=T(Ie,2);{let Ze=z(()=>l(a)._status??""),it=z(()=>l(a).id===l(S)||l(a).id===l(k));ku(fe,{get status(){return l(Ze)},get isLatest(){return l(it)}})}var te=T(rt,2),ae=_(te),me=_(ae),ce=T(ae,2),pe=T(xe,2);{var Te=Ze=>{var it=hN(),$e=_(it),Je=_($e);J(()=>$(Je,l(d)?"No modified fields":"No fields to display")),y(Ze,it)},Be=Ze=>{var it=vN();Ue(it,21,()=>l(x),$e=>$e.name,($e,Je)=>{oN($e,{get fieldName(){return l(Je).name},get fieldLabel(){return l(Je).label},get fieldType(){return l(Je).type},get oldValue(){return l(m)[l(Je).name]},get newValue(){return l(v)[l(Je).name]}})}),y(Ze,it)};K(pe,Ze=>{l(x).length===0?Ze(Te):Ze(Be,-1)})}var dt=T(ie,2);Wp(dt,{get hasDrafts(){return l(p)},get isRestoring(){return l(g)},onRestore:V,get open(){return l(f)},set open(Ze){A(f,Ze,!0)}}),J((Ze,it,$e,Je,ot,je)=>{X(F,"href",Ze),$(R,l(o).labelPlural||l(o).label),X(B,"href",it),$(re,l(r)),X(le,"href",$e),$(Ae,Je),$(ze,ot),$(me,je)},[()=>Ye(`/${l(t)}`),()=>Ye(`/${l(t)}/${l(r)}`),()=>Ye(`/${l(t)}/${l(r)}/versions`),()=>O(l(a).createdAt),()=>O(l(a).createdAt),()=>E(l(a).createdAt)]),Hu(Ce,()=>l(d),Ze=>A(d,Ze)),ee("click",ce,()=>A(f,!0)),y(W,H)};K(U,W=>{l(o)?l(c)?W(j,1):l(a)?W(Z,-1):W(Y,2):W(M)})}y(n,G),ve()}ye(["click"]);var _N=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Loading...</p></div>'),bN=P('<div class="flex h-full items-center justify-center"><p class="text-muted-foreground">Loading...</p></div>'),yN=P('<p class="mt-1 text-sm text-muted-foreground"> </p>'),xN=P('<header class="sticky top-0 z-10 border-b border-border bg-background"><div class="flex items-center justify-between px-7 py-3.5"><div class="flex min-w-0 items-center gap-2.5 text-[13px] text-muted-foreground"><span class="font-medium text-foreground"> </span></div> <button type="button" class="bg-primary px-4 py-2 text-xs font-semibold tracking-wide text-primary-foreground rounded-lg shadow-sm transition-colors hover:bg-primary/90 disabled:opacity-60"> </button></div> <div class="px-7 pb-5 pt-5"><h1 class="font-display text-[28px] font-semibold leading-tight tracking-tight text-foreground"> </h1> <!></div></header> <div class="px-7 py-8"><div class="max-w-2xl"><!></div></div>',1);function wN(n,e){he(e,!0);let t=z(()=>_n.params.key??""),r=z(()=>hn.globals.find(h=>h.key===l(t))),i=Q(We({})),o=Q(We({})),s=Q(!0),a=Q(!1),u=Q(We({}));gt(()=>{l(t)&&l(r)&&c(l(t))});async function c(h){A(s,!0);const w=await Th(h);A(s,!1),w.ok?(A(i,w.data,!0),A(o,{...w.data},!0)):Ke.error(w.error)}async function d(){A(a,!0),A(u,{},!0);const h=await Jy(l(t),l(o));A(a,!1),h.ok?(A(i,h.data,!0),A(o,{...h.data},!0),Ke.success("Settings saved")):(h.details&&A(u,h.details,!0),Ke.error(h.error))}var f=ne(),g=q(f);{var p=h=>{var w=_N();y(h,w)},v=h=>{var w=bN();y(h,w)},m=h=>{var w=xN(),b=q(w),x=_(b),S=_(x),k=_(S),C=_(k),N=T(S,2),O=_(N),E=T(x,2),D=_(E),L=_(D),V=T(D,2);{var G=Y=>{var Z=yN(),W=_(Z);J(()=>$(W,l(r).description)),y(Y,Z)};K(V,Y=>{l(r).description&&Y(G)})}var U=T(b,2),M=_(U),j=_(M);Rp(j,{get fields(){return l(r).fields},get initialData(){return l(i)},get errors(){return l(u)},get formData(){return l(o)},set formData(Y){A(o,Y,!0)}}),J(()=>{$(C,l(r).label),N.disabled=l(a),$(O,l(a)?"Saving…":"Save"),$(L,l(r).label)}),ee("click",N,d),y(h,w)};K(g,h=>{l(r)?l(s)?h(v,1):h(m,-1):h(p)})}y(n,f),ve()}ye(["click"]);var kN=P('<div class="flex justify-center py-12"><div class="h-6 w-6 rounded-full border-2 border-primary/20 border-t-primary animate-spin"></div></div>'),SN=P('<p class="px-4 py-8 text-center text-sm text-muted-foreground">No data for selected range.</p>'),CN=P('<tr class="border-t border-border/60"><td class="px-4 py-2"> </td><td class="px-4 py-2 text-right tabular-nums"> </td><td class="px-4 py-2 text-right tabular-nums"> </td><td class="px-4 py-2 text-right tabular-nums"> </td></tr>'),TN=P('<table class="w-full text-sm"><thead class="bg-muted/40 text-left text-xs uppercase tracking-wide text-muted-foreground"><tr><th class="px-4 py-2">Ad Title</th><th class="px-4 py-2 text-right">Impressions</th><th class="px-4 py-2 text-right">Clicks</th><th class="px-4 py-2 text-right">CTR %</th></tr></thead><tbody></tbody></table>'),EN=P('<div class="space-y-6"><header class="flex items-center justify-between"><div><h1 class="text-2xl font-semibold tracking-tight">Ad Analytics</h1> <p class="text-sm text-muted-foreground">Impressions, clicks, and CTR per ad.</p></div> <div class="flex items-end gap-3"><label class="flex flex-col text-xs text-muted-foreground">From <input type="date" class="mt-1 h-9 rounded-md border border-border bg-card px-2 text-sm"/></label> <label class="flex flex-col text-xs text-muted-foreground">To <input type="date" class="mt-1 h-9 rounded-md border border-border bg-card px-2 text-sm"/></label></div></header> <section class="rounded-lg border border-border bg-card p-4"><h2 class="mb-3 text-sm font-semibold">Daily Impressions</h2> <!></section> <section class="rounded-lg border border-border bg-card p-4"><h2 class="mb-3 text-sm font-semibold">Daily Clicks</h2> <!></section> <section class="rounded-lg border border-border bg-card"><header class="border-b border-border px-4 py-3"><h2 class="text-sm font-semibold">Per-Ad Summary</h2></header> <!></section></div>');function NN(n,e){he(e,!0);let t=Q(We([])),r=Q(We([])),i=Q(We([])),o=Q(!1);function s(U){return U.toISOString().slice(0,10)}const a=new Date,u=new Date;u.setDate(a.getDate()-30);let c=Q(We(s(u))),d=Q(We(s(a)));function f(U,M){const j=new Date(U),Y=new Date(M),Z=Math.round((Y.getTime()-j.getTime())/(1e3*60*60*24));return Z<=1?"today":Z<=7?"7d":Z<=30?"30d":"all"}async function g(){A(o,!0);const U=f(l(c),l(d));try{const M=await fetch(`/api/ads/analytics?range=${U}&from=${l(c)}&to=${l(d)}`,{credentials:"include"});if(!M.ok){Ke.error(`Failed to load analytics (${M.status})`);return}const j=await M.json();A(t,j.summary??[],!0),A(r,j.impressionsByDay??[],!0),A(i,j.clicksByDay??[],!0)}catch(M){Ke.error(`Network error: ${M.message}`)}finally{A(o,!1)}}_t(()=>{g()});function p(){g()}var v=EN(),m=_(v),h=T(_(m),2),w=_(h),b=T(_(w)),x=T(w,2),S=T(_(x)),k=T(m,2),C=T(_(k),2);$s(C,{get data(){return l(r)},emptyMessage:"No impressions in range."});var N=T(k,2),O=T(_(N),2);$s(O,{get data(){return l(i)},emptyMessage:"No clicks in range."});var E=T(N,2),D=T(_(E),2);{var L=U=>{var M=kN();y(U,M)},V=U=>{var M=SN();y(U,M)},G=U=>{var M=TN(),j=T(_(M));Ue(j,21,()=>l(t),ut,(Y,Z)=>{var W=CN(),H=_(W),ie=_(H),I=T(H),F=_(I),R=T(I),B=_(R),re=T(R),le=_(re);J(()=>{$(ie,l(Z).title||"(untitled)"),$(F,l(Z).impressions),$(B,l(Z).clicks),$(le,l(Z).ctr)}),y(Y,W)}),y(U,M)};K(D,U=>{l(o)?U(L):l(t).length===0?U(V,1):U(G,-1)})}ee("change",b,p),Mt(b,()=>l(c),U=>A(c,U)),ee("change",S,p),Mt(S,()=>l(d),U=>A(d,U)),y(n,v),ve()}ye(["change"]);var AN=P(`<div class="flex h-[60vh] flex-col items-center justify-center gap-2 text-center"><h1 class="text-2xl font-semibold">Page not found</h1> <p class="text-muted-foreground">The admin URL you followed doesn't match any known route.</p> <a class="text-primary underline mt-2">Back to dashboard</a></div>`);function Hp(n,e){he(e,!1),ss();var t=AN(),r=T(_(t),4);J(i=>X(r,"href",i),[()=>Ye("/")]),y(n,t),ve()}var MN=P('<div class="p-6 text-red-600"> </div>'),PN=P('<div class="p-6 text-muted-foreground">Loading…</div>');function ON(n,e){he(e,!0);const t=Ca(),r=z(()=>br.params.slug??""),i=z(()=>t.config.pages[l(r)]);let o=Q(null),s=Q(null);gt(()=>{A(o,null),A(s,null),l(i)&&vh(l(i).path,t.importMap).then(p=>{A(o,p,!0)}).catch(p=>{A(s,p instanceof Error?p.message:String(p),!0),console.error(`[quoin:CustomPageView] Failed to load "${l(r)}":`,p)})});var a=ne(),u=q(a);{var c=p=>{Hp(p,{})},d=p=>{var v=MN(),m=_(v);J(()=>$(m,`Failed to load page: ${l(s)??""}`)),y(p,v)},f=p=>{const v=z(()=>l(o));var m=ne(),h=q(m);Qt(h,()=>l(v),(w,b)=>{b(w,{})}),y(p,m)},g=p=>{var v=PN();y(p,v)};K(u,p=>{l(i)?l(s)?p(d,1):l(o)?p(f,2):p(g,-1):p(c)})}y(n,a),ve()}var DN=P("<!> <!>",1);function IN(n,e){he(e,!0),Vb({config:e.config,importMap:e.importMap}),qy(),Bb([{pattern:"/login"},{pattern:"/ads-analytics"},{pattern:"/pages/:slug"},{pattern:"/globals/:key"},{pattern:"/:collection/:id/versions/:vid"},{pattern:"/:collection/:id/versions"},{pattern:"/:collection/new"},{pattern:"/:collection/:id"},{pattern:"/:collection"},{pattern:"/"}]);const r=z(()=>br.path);var i=DN(),o=q(i);Fb(o,{position:"top-right",richColors:!0,closeButton:!0});var s=T(o,2);{var a=c=>{ix(c,{})},u=c=>{Tx(c,{children:(d,f)=>{var g=ne(),p=q(g);{var v=M=>{n0(M,{})},m=M=>{NN(M,{})},h=M=>{ON(M,{})},w=z(()=>l(r).startsWith("/pages/")),b=M=>{wN(M,{})},x=z(()=>l(r).startsWith("/globals/")),S=M=>{mN(M,{})},k=z(()=>/^\/[^/]+\/[^/]+\/versions\/[^/]+$/.test(l(r))),C=M=>{zE(M,{})},N=z(()=>/^\/[^/]+\/[^/]+\/versions$/.test(l(r))),O=M=>{wE(M,{})},E=z(()=>/^\/[^/]+\/new$/.test(l(r))),D=M=>{NE(M,{})},L=z(()=>/^\/[^/]+\/[^/]+$/.test(l(r))),V=M=>{q0(M,{})},G=z(()=>/^\/[^/]+$/.test(l(r))),U=M=>{Hp(M,{})};K(p,M=>{l(r)==="/"?M(v):l(r)==="/ads-analytics"?M(m,1):l(w)?M(h,2):l(x)?M(b,3):l(k)?M(S,4):l(N)?M(C,5):l(E)?M(O,6):l(L)?M(D,7):l(G)?M(V,8):M(U,-1)})}y(d,g)},$$slots:{default:!0}})};K(s,c=>{l(r)==="/login"?c(a):c(u,-1)})}y(n,i),ve()}const Vp={apiBase:"/api",basePath:"/admin",buildOutDir:"./dist",devPort:5173,brand:{name:"Quoin",logo:null},fields:{},slots:{},views:{},pages:{}},FN={};Rb(Vp.basePath);Kb();const Jp=document.getElementById("app");if(!Jp)throw new Error("#app mount target not found in index.html");oh(IN,{target:Jp,props:{config:Vp,importMap:FN}});
|